AI Hints
Home›Git & GitHub Tutorial›GitHub Pages and Actions
Git & GitHub · Lesson 111 of 144

Checks on Pull Requests

Green ticks and red crosses.

⏱ 2 min read▶ Video at 2:01:30🎓 Free
Watch this lesson in the Git & GitHub courseWatch on YouTube ↗Full Git & GitHub course

Once a workflow exists, every pull request shows its result. A green tick if everything passed, and a red cross if something failed. Together with branch protection, you can make sure nothing broken ever reaches main.

Checks on Pull Requests
From the video: Checks on Pull Requests
  • Every PR shows the result
  • Green tick, or red cross
  • Nothing broken reaches main

Running the same check yourself

The check is just a script, so you can run it on your own computer first. Cat shows it loops over every page, looking for a heading. All our pages have one, so it prints all pages OK. Then we add a page without a heading, and run it again. Missing heading, blog dot HTML. That's exactly what would turn the pull request red.

git
cat check.sh
for f in *.html; do
  grep -q "<h1>" "$f" || { echo "Missing heading: $f"; exit 1; }
done
echo "All pages OK"
sh check.sh
All pages OK
echo '<p>No heading here</p>' > blog.html
sh check.sh
Missing heading: blog.html

Where to go next

Actions can do far more. Run your tests in many languages. Build and deploy your app. Publish packages. Even label issues automatically. The Actions tab, in every repository, has ready-made templates to start from.

Testevery push
Deployon merge to main
Releasepublish packages
Templatesin the Actions tab

Summary

Workflows add green ticks and red crosses to pull requests, and protect main from broken code. Next, Git outside the terminal.

Key takeaways
  • Checks on every PR
  • Run them locally too
  • Protect main with checks
Next up: Git in Your Editor — VS Code and friends