Skip to content

Commit ec8c5f3

Browse files
authored
fix(ci): stop the CodeQL cron cancelling the main merge scan (#7933)
The workflow-level `cancel-in-progress: true` applied to every trigger, but push and schedule both resolve to `refs/heads/main` and therefore share the `codeql-refs/heads/main` concurrency group. A merge landing shortly before the daily cron had its scan cancelled mid-extraction, leaving main with a red status rollup for a commit the cron then scanned clean. Scoping the cancel to `pull_request` keeps the superseding behavior where it belongs -- each PR is its own group via `refs/pull/N/merge` -- and lets non-PR events queue behind an in-progress run instead of killing it.
1 parent f12c881 commit ec8c5f3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ on:
6262

6363
concurrency:
6464
group: codeql-${{ github.ref }}
65-
cancel-in-progress: true
65+
# PR runs only. Superseding is what this is for: a PR push makes the previous
66+
# scan of that PR irrelevant, and `refs/pull/N/merge` keeps each PR in its own
67+
# group. The push and schedule triggers both resolve to `refs/heads/main`, so a
68+
# blanket `true` let the daily cron cancel the merge scan of the same commit --
69+
# a 2-minute window that finally landed on 3c8a4c4 (push 08:32:58 killed by the
70+
# 08:34:47 cron), leaving main with a red rollup for a commit that the cron had
71+
# in fact scanned clean. Non-PR events now queue instead: one pending run is
72+
# held per group, so the cron simply waits out the merge scan.
73+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
6674

6775
permissions:
6876
contents: read

0 commit comments

Comments
 (0)