Skip to content

ci: skip redundant push-triggered runs cleanly instead of cancelling them#325

Merged
LeoBuron merged 1 commit into
developfrom
ci-skip-not-cancel-redundant-runs
Jul 9, 2026
Merged

ci: skip redundant push-triggered runs cleanly instead of cancelling them#325
LeoBuron merged 1 commit into
developfrom
ci-skip-not-cancel-redundant-runs

Conversation

@LeoBuron

@LeoBuron LeoBuron commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Test plan

  • .github/workflows/ci.yml validated as well-formed YAML; every job confirmed to carry needs: gate + the if guard
  • Observe the next time a commit lands on develop while a developmain release PR is open: expect the push-triggered run's jobs to show skipped, not cancelled/fail

…them

The concurrency-cancel fix from #323 dedupes push+pull_request duplicate
runs on the same commit, but a cancelled run's jobs surface as
failed-looking red X's in the PR checks list (confirmed live on #324:
run 29046387852 was cancelled mid-flight, its 6 jobs all showing "fail"
in `gh pr checks`) -- not acceptable even though it doesn't block
merging.

Replace it with a `gate` job: for push events, it checks (via `gh pr
list`) whether the pushed commit is already the head of an open PR. If
so, that PR's own pull_request-triggered run already provides full
coverage, so every other job's `if: needs.gate.outputs.proceed ==
'true'` skips them outright -- before any real job starts, showing a
clean neutral "skipped" instead of cancelled/failed. pull_request-
triggered runs always proceed (gate is a no-op for them), and ordinary
pushes with no open PR are unaffected.
@LeoBuron LeoBuron merged commit 93ebb1c into develop Jul 9, 2026
11 checks passed
@LeoBuron LeoBuron deleted the ci-skip-not-cancel-redundant-runs branch July 9, 2026 20:30
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