A Green Tick on Your Pull Request
Open a pull request on almost any real project and something starts happening by itself. A spinner appears beside your commits, runs for a minute or two, and turns into a green tick or a red cross.
Nobody explains this, and a red cross on your first contribution is alarming out of all proportion. So here it is in one page: that is continuous integration, and it is checking your work.
What is actually happening
The project contains instructions, written by somebody once, saying: whenever a change arrives, start a fresh machine, fetch the code, and run these checks.
On GitHub the service that does this is called GitHub Actions, and the instructions live in files inside the repository. Other services do the same job under other names. The important part is that it is automatic, it runs on a clean machine rather than on anyone's laptop, and it happens to every change equally.
What it usually checks
Three things, in most projects.
That the project builds — that the code compiles or the site assembles, on a machine that has none of your local setup.
That the tests pass — the automated checks the project keeps, run against your change to see whether it broke anything that used to work.
That the formatting matches — indentation, quotes, unused imports. Small, mechanical, and much better handled by a machine than by a human reviewer spending attention on it.
Reading the result
Green means every configured check passed. Red means at least one failed, and there is a log saying which.
Open the log and read the last lines first. Build and test output is enormous and mostly uninteresting; the failure is almost always near the end, and it usually names a file and a line.
When it fails on your pull request
It is normal. It happens to everyone, including the people who wrote the checks.
It is also not a rejection: nobody has judged anything. A machine ran a list and one item did not pass. The fix is another commit pushed to the same branch, exactly as in Chapter 8 — and the checks run again automatically, without you asking.
git add style.css git commit -m "Add the missing closing brace" git push
Why teams bother
Because the alternative is finding out later. Without checks, a change that breaks the build reaches main, then reaches the live site, and the team learns about it from a user — which is the most expensive possible moment to discover anything.
Running the checks on every proposal moves that discovery to before the merge, when it costs one commit.
What green does not promise
It means the configured checks passed. It does not mean the change is correct, or a good idea, or what anyone asked for.
Checks only test what somebody wrote a test for. That is exactly why review from a human still happens alongside them, and why a green tick is a precondition for merging rather than a reason to merge.
Writing these workflows — what the files look like, how the checks are defined, how a project deploys itself once they pass — is three chapters of the deep dive. This page is what it is; that book is how to build one.
- "A red cross means my code was rejected." It means a check failed. Nobody has judged anything. Push a fix and it runs again by itself.
- "I have to set this up before I can contribute." The project sets it up once. Contributors only ever read the result.
- "Green means the change is correct." It means the configured checks passed, and they only cover what somebody wrote a test for. That is why human review continues to exist.
- "The checks run on my machine, so a local problem could cause the failure." They run on a fresh machine with none of your setup, which is one of the main reasons they are worth having.
- Every reader will meet this on their first real pull request, and it is intimidating precisely because it appears without introduction.
- Knowing that a failure is answered with another commit keeps the whole thing inside a loop you already know, rather than making it a new kind of problem.
- It is the honest boundary with the deep dive: this page says what it is, and that book says how to write one.
Knowledge Check
What is happening when checks run on your pull request?
- A fresh machine fetches the code and runs the checks the project defined
- A reviewer is running the project locally and reporting what they find
- GitHub is scanning your code for security problems before allowing a merge
- Your own machine is running the tests and uploading the results to GitHub
The checks fail on your first contribution. What does that mean?
- One of the configured checks did not pass, and the log says which one
- Your pull request has been rejected and will need to be opened again
- The project's checks are broken, since a documentation fix cannot fail a build
- You need permission from a maintainer before the checks will run properly
What does a green tick promise?
- That the configured checks all passed, and nothing at all beyond that
- That the change is correct and safe to merge without further review
- That the change matches what the issue asked for in the first place
- That every test in the project passed, including ones not configured to run
How do you respond to a failed check?
- Push another commit to the same branch, and the checks rerun automatically
- Close the pull request and open a new one once the problem is fixed
- Ask a maintainer to override the failure so the change can be merged
- Run the checks again unchanged, since failures are often intermittent
You got correct