Re-check the live PR state at the start of the cleanup job and again
right before deleting the draft, so a PR that is reopened while the
cleanup is queued or waiting keeps its rolling draft and its fresh
reopened-run builds are not cancelled.
Addresses Codex round-6 feedback on #1202.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A manually dispatched build on the same head branch is not the PR's
work; filter the cancellation list by event so PR-close cleanup cannot
abort it.
Addresses Codex round-5 feedback on #1202.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gh run cancel needs the actions scope; with only contents: write the
cancellation 403s silently and the settle-poll burns its full window.
Also skip the cleanup job for fork PRs entirely: they never get a
draft and their token is read-only regardless of the permissions block.
Addresses Greptile P1 / Codex P2 follow-up on #1202.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Move concurrency from workflow level to job level: cancelling a whole
run could interrupt action-gh-release mid-asset-replacement and leave
the rolling draft incomplete. Build slots still cancel superseded PR
work (matrix-aware groups); the release job gets its own serializing,
never-cancelling group.
- Re-check the live PR state in the release job right before touching
the draft, so a build that outlives its PR cannot recreate the draft
after cleanup deleted it.
- In the cleanup workflow, cancel still-running builds of the closed PR
(dead work anyway) and wait for them to settle before deleting.
- Emit an explicit empty `body=` output for tag builds instead of a
blank-line heredoc.
Addresses Codex and Greptile review feedback on #1202.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every PR and master build created a draft named "Release v<version>"
with tag test-<github.sha>, so 70+ identical drafts piled up and PR
drafts were untraceable (for pull_request events github.sha is the
ephemeral merge-commit SHA that resolves to nothing in the repo).
- Title test drafts as "v<ver> — PR #<n> @ <sha> [test]" /
"v<ver> — master @ <sha> [test]"; tag releases keep "Release v<ver>"
- Prepend a context header (PR, head commit, workflow run links) to the
auto-generated release notes
- Use the PR head SHA and pass target_commitish so generated notes
actually cover the PR commits
- Use stable tags (test-pr-<n>, test-master) so action-gh-release
updates one rolling draft in place instead of creating a new one per
push
- Mark all non-tag drafts as prerelease
- Cancel superseded in-progress PR builds via a concurrency group
- Delete a PR's rolling draft when the PR closes (new workflow)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>