Skip to content

Stop the Release Supersede Dispatch From Cancelling a Pending Publish in the Global Concurrency Group #2320

Closed

Description

@ptr727

Problem

build-release-task.yml's github-release job has a D4.7 supersede step. When the branch head has moved, with different workflow files, through bot-only pushes, the step runs gh workflow run <publisher> --ref <branch> and then cancels its own run.

The catalog caller snippet catalog/snippets/workflows/publish-release.yml puts the publisher in one global group:

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: false

GitHub keeps at most one pending run per concurrency group. A newly queued run cancels whatever run is already pending in that group, even with cancel-in-progress: false. So the run the supersede step dispatches can silently replace a pending publish of a different branch.

Constructed scenario

  1. A maintainer dispatches the publisher on develop (run A).
  2. The maintainer dispatches it on main (run B). B waits as pending behind A.
  3. While A is still in its validate jobs, a Dependabot github-actions bump merges to develop.
  4. A's github-release job sees the workflow change, dispatches the publisher on develop (run C), and cancels itself.
  5. C joins the group and replaces pending run B. B is cancelled and the main release never happens. Nothing reports it, beyond a cancelled run in the list.

A pending scheduled run can be dropped the same way.

Options

  1. Change the snippet to a ref-scoped group, ${{ github.workflow }}-${{ github.ref }}, keeping cancel-in-progress: false. A supersede then only replaces a pending run on its own branch, which it publishes anyway. The cost is that two branches can publish at the same time, but their tags and releases differ.
  2. Keep the global group and have the supersede step refuse, instead of dispatching, when the group already has a pending run.
  3. Keep both and document the race in WORKFLOW.md D4.7 for adopters.

Found while adopting the release chain in ptr727/homeassistant-purpleair (ptr727/homeassistant-purpleair#365). That repo keeps its global group for now, pending a decision here.

Activity

  1. ptr727 commented on Oct 4, 2026

    @ptr727
    OwnerAuthor

    Maintainer decision (2026-10-03): key the publisher's concurrency group on the ref, ${{ github.workflow }}-${{ github.ref }} with cancel-in-progress: false, and put any run the plan cannot publish in its own per-run group. Together with #2300 this closes both constructed scenarios. Being implemented in one PR with #2300.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions