Learning center

Your commit's run was cancelled and a later commit is green. Is your commit tested?

Only as part of the later commit. When a workflow uses a concurrency group, a newer push can cancel the run for yours, and the green run that follows tested the later tree, which holds your change plus everything after it. Ship the green commit, or start a run for the exact commit you ship; do not cite the later run as evidence for a commit it did not check out.

Why runs get cancelled#

A workflow or job with a concurrency group allows one running and one pending run per group. GitHub's documentation says that "by default, any existing pending job or workflow in the same concurrency group will be canceled and the new queued job or workflow will take its place", and cancel-in-progress: true also cancels the running one. Control the concurrency of workflows and jobs

So a busy branch loses runs even without cancel-in-progress. A group keyed on the branch, such as ${{ github.workflow }}-${{ github.ref }}, makes every push to main compete with the one before it.

A real branch#

The Home Assistant core repository's CI workflow uses this group for pushes to its dev branch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

These are its push runs on the morning of 2 December 2026, read from the workflow runs API, with every run of that workflow for each commit and the annotation GitHub left on the cancelled job:

2026-12-02T06:04:11Z run 46821766981 8b6a734180a0 cancelled   all ci.yaml runs for this commit: [cancelled]
    annotation: Canceling since a higher priority waiting request for CI-refs/heads/dev exists
[…]
2026-12-02T06:13:58Z run 46823032736 c01c80546fea cancelled   all ci.yaml runs for this commit: [cancelled]
    annotation: Canceling since a higher priority waiting request for CI-refs/heads/dev exists
2026-12-02T06:20:48Z run 46823910319 868dc2249958 success   all ci.yaml runs for this commit: [success]
parents:
  868dc2249958 parent c01c80546fea

Five consecutive commits have only a cancelled run. The sixth passed, and the compare API reports each of the five as an ancestor of it. With the default checkout, a push run tests the pushed commit, so the green run tested a tree that started from all five. A later commit could still have reverted part of one, so ancestry alone does not show that a change survived. None of the five was tested on its own.

What the later green covers#

You shipIs the green run evidence?
The green commit, or a later one with its own green runYes, for that commit
A cancelled commit that is an ancestor of the green oneOnly that the code passed together with the later changes. A later change can fix or hide a failure your commit had alone
A cherry-pick of a cancelled commit to a release branchNo. The release branch tree was never tested
A cancelled commit when a later change was revertedNo. Check whether the revert touched your files

Check ancestry before you lean on a later run:

git merge-base --is-ancestor YOUR_SHA GREEN_SHA
echo $?   # 0 contained, 1 not contained, anything else an error such as a missing commit

A cancelled run can also come from a person pressing cancel. When concurrency cancelled a job that had started, the job usually carries an annotation that names the group. Read it from the cancelled job:

gh api repos/OWNER/REPO/check-runs/JOB_ID/annotations --jq '.[].message'

A run cancelled while still pending may have no job and no annotation, so a missing annotation does not show that a person cancelled it.

Keep runs for the commits you ship#

GitHub's example cancel-in-progress: ${{ !contains(github.ref, 'release/')}} stops a new push from cancelling a running release build, but a pending run in the same group is still replaced. To keep pending runs too, set queue: max, which lets up to 100 runs wait. The documentation notes that queue: max cannot be combined with cancel-in-progress: true. For a single commit, gh workflow run WORKFLOW --ref BRANCH starts a run on the branch tip only. For an older commit, push it to a temporary branch and dispatch there, if the workflow has a workflow_dispatch trigger. Then confirm that the run's head_sha is that commit.

This is the same question as a rerun that passed: name the run and the commit it checked out. Return to handing over evidence.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading