โGive me the markdown for a GitHub Actions status badge for a workflow named CI, and explain how to make CI a required status check on main.โ
09 โ [Optional] Status badges & branch protection
Category: Polish ยท Priority: Low ยท Step: 10 ยท Optional
Show a green build badge in your README and require CI to pass before merging.
๐ฏ What is this task?
Two finishing touches that make a repo look (and behave) professional:
- A status badge in your README that shows live CI status.
- Branch protection that blocks merging a pull request until CI is green.
๐ค AI Prompt
"Give me the markdown for a GitHub Actions status badge for my workflow named CI, and explain how to make CI a required status check on the main branch."
๐ Step-by-step
Status badge โ add to the top of README.md:

Replace OWNER/REPO with your repo path. The badge turns green/red automatically.
Branch protection
Repo โ Settings โ Branches โ Add branch ruleset (or classic protection rule) for main:
- โ Require a pull request before merging
- โ
Require status checks to pass โ select your
testcheck - โ Require branches to be up to date before merging
Now a red pipeline physically blocks the Merge button.
โ Done when
- A CI badge shows in your README
-
mainrequires thetestcheck to pass before merge - A failing PR cannot be merged
๐ Quiz
Answer all 1 questions correctly to complete this lesson.