Skip to content

feat(ci): cancel superseded workflow runs #1395

Backlog

Description

@TheShinriel

Problem

validate.yml, codeql.yml, release-video-dry-run.yml and dependabot-auto-merge.yml declare no concurrency. Pushing twice to a pull request runs the full pre-commit (validate.yml) and CodeQL twice, the first run wasted.

Scope

  • Group ${{ github.workflow }}-${{ github.ref }}, cancelling everywhere except main, on validate.yml, codeql.yml, release-video-dry-run.yml (copied from ci.yml).
  • dependabot-auto-merge.yml keys on the pull request number: under pull_request_target, github.ref is the base branch, so a ref-based group would cancel one Dependabot PR's run with another's.
  • A guard failing when a workflow triggered by push, pull_request or pull_request_target has no top-level concurrency.

Acceptance criteria

  • Two pushes in a row to a PR leave the first Validate run cancelled (gh run list --workflow validate.yml).
  • A push to main is never cancelled.
  • Removing one concurrency block makes the guard fail, naming the workflow.

Prior art in this repo

ci.yml and cli-ci.yml already use the group and the main exception; opencode.yml keys on the issue or PR number.

Out of scope

Scheduled and manual workflows, which already serialize or run alone.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions