Skip to content

ci: actually dedupe the push and pull_request runs - #19

Merged
Harsh-2002 merged 2 commits into
mainfrom
fix/ci-duplicate-runs
Aug 31, 2026
Merged

ci: actually dedupe the push and pull_request runs#19
Harsh-2002 merged 2 commits into
mainfrom
fix/ci-duplicate-runs

Conversation

@Harsh-2002

Copy link
Copy Markdown
Owner

The concurrency block says it keeps one run per branch. It doesn't — the key differs between the two events:

event head_ref ref resulting group
push on x empty refs/heads/x ci-CI-refs/heads/x
pull_request from x x refs/pull/N/merge ci-CI-x

Different groups, so nothing gets cancelled and the full five-job matrix runs twice for every PR — including the two ~4-minute Windows jobs.

Observed on every branch this session:

1 fix/clippy-chunks-exact push
1 fix/clippy-chunks-exact pull_request
1 fix/pdf-panel-details push
1 fix/pdf-panel-details pull_request
...

github.ref_name is the bare branch name on a push, so github.head_ref || github.ref_name puts both events in the same group and the newer run cancels the older. Roughly halves CI minutes per PR, with no change to what is actually checked.

The concurrency group was meant to keep one run per branch, but the key did
not match between the two events: github.ref is refs/heads/x on a push while
github.head_ref is a bare x on a pull_request, so they landed in different
groups and the full five-job matrix ran twice for every PR.

ref_name is the bare branch name on a push, so both events now share a group.
A branch in this repo fires both push and pull_request, and the concurrency
key did not match between them -- github.ref is refs/heads/x on a push while
head_ref is a bare x -- so the full five-job matrix, including two four-minute
Windows jobs, ran twice for every PR.

Fixing the key alone only cancels one of the two, and a cancelled job still
reports as failed, which is its own noise. Watch main directly and let pull
requests cover everything else, so each change is checked exactly once.
@Harsh-2002
Harsh-2002 merged commit 433d4a3 into main Aug 31, 2026
5 checks passed
@Harsh-2002
Harsh-2002 deleted the fix/ci-duplicate-runs branch August 31, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant