Skip to content

fix(gate): cancel PR runs only for new commits #72

Closed

Description

@uniqueg

Why?

A run that a newer run on the same commit cancels (e.g. for edited or ready_for_review) leaves a failed CI passed as the newest result on the head commit, which blocks the merge (#70). Skipping the gate in cancelled runs (!cancelled()) is no fix: GitHub counts a skipped required check as passed, so a run cancelled by hand would allow merging untested code.

What?

  • Only a new head commit cancels a PR's run in progress: cancel-in-progress true only for pull_request with action synchronize on the first attempt; other runs wait.
  • The gate stays if: always() and fails closed.
  • Apply this in this repo's ci.yml, document it in actions/gate/README.md ("Cancelled runs"), and test both in tests/gate/test.sh.

Acceptance criteria

  • Runs on the same commit no longer cancel each other; a new commit still cancels the old commit's run.
  • A cancelled or failed needed job still fails CI passed.
  • The README documents the concurrency block for callers.

Part of #70.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: hightype: bugworkload: hours

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions