From 4800814b9df422c062cb964b8b576c7622035796 Mon Sep 17 00:00:00 2001 From: Johnathan Falk Date: Fri, 6 Nov 2026 09:55:54 -0500 Subject: [PATCH 1/4] fix(release): collect the changelog in its own job, via a PR when pushes are refused Changelog collection was the last step of create-release, before the step that writes release-created. A ruleset refusal (GH013) failed the job before that output existed, so publish-github-packages and update-floating-tags skipped a release that was otherwise complete. Move it to a collect-changelog job after create-release. Keep the direct push; on a protection refusal open a changelog/collect- PR with the CI App token (falling back to the PAT, then GITHUB_TOKEN) and enable rebase auto-merge so a merge queue takes it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011To9HQJLrCH6wYa5WCpw3L --- .github/guid-index.json | 2 +- .github/workflows/reusable-release.yml | 273 ++++++++++++------ ...61106_changelog_collect_job_pr_fallback.md | 22 ++ 3 files changed, 214 insertions(+), 83 deletions(-) create mode 100644 changelog.d/20261106_changelog_collect_job_pr_fallback.md diff --git a/.github/guid-index.json b/.github/guid-index.json index e6cb450d..9d9137c0 100644 --- a/.github/guid-index.json +++ b/.github/guid-index.json @@ -1003,7 +1003,7 @@ "path": ".github/workflows/reusable-release.yml", "guid": "7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e", "title": "Reusable Release Coordinator", - "version": "2.16.1", + "version": "2.17.0", "header_path": ".github/workflows/reusable-release.yml", "path_mismatch": false }, diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 5883b4af..740b5e9e 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -1,7 +1,7 @@ # file: .github/workflows/reusable-release.yml -# version: 2.16.1 +# version: 2.17.0 # guid: 7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e -# last-edited: 2026-10-16 +# last-edited: 2026-11-06 name: Reusable Release Coordinator @@ -780,86 +780,6 @@ jobs: # back to the default branch. Opt-in by presence: only runs when the # calling repo has changelog.d/scriv.ini (see changelog.d/README.md in # falkcorp/github-common). No-op for every repo without that file. - - name: Collect changelog fragments - if: >- - github.event_name != 'pull_request' && - inputs.changelog-collect != 'false' && - needs.detect-languages.outputs.auto-prerelease != 'true' && - hashFiles('changelog.d/scriv.ini') != '' - env: - VERSION: ${{ steps.version.outputs.version }} - DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - CHANGELOG_PAT: ${{ secrets.JF_CI_GH_PAT }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - - if [ -z "${VERSION:-}" ]; then - echo "::warning::No version resolved; skipping changelog collect." - exit 0 - fi - - # Defensive: scriv needs a CHANGELOG.md carrying the insert marker. - # Skip cleanly if the repo has scriv.ini but no marker-bearing changelog. - if [ ! -f CHANGELOG.md ] || ! grep -q 'scriv-insert-here' CHANGELOG.md; then - echo "::warning::changelog.d/scriv.ini present but CHANGELOG.md lacks the scriv-insert-here marker; skipping collect." - exit 0 - fi - - # Only real fragments count — README.md, templates/ and scriv.ini don't. - # - # Do NOT write this as `find ... | grep -q .`. `grep -q` exits on the - # first match, closing the pipe; `find` then dies on EPIPE, and under - # `set -o pipefail` the pipeline reports FAILURE even though grep - # succeeded. The leading `!` therefore fires this "no fragments" - # branch precisely when there are MANY fragments — and it exit 0s, so - # the release stays green while collection is silently skipped. - # - # The trigger is a RACE, not a size threshold: `find` loses only if it - # is still writing when `grep` exits. A handful of fragments fit in a - # single write() that lands before grep is scheduled, so nothing goes - # wrong; hundreds mean many writes and grep almost always wins first. - # Note 36 KB is well under the 64 KB pipe buffer — a FULL buffer is - # not what breaks this. audiobook-organizer collected fine at 131 - # fragments, then silently skipped six releases at 675. - # `-print -quit` stops at the first hit and needs no pipeline at all. - if [ -z "$(find changelog.d -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit)" ]; then - echo "::notice::No changelog fragments to collect for ${VERSION}." - exit 0 - fi - - python3 -m pip install --quiet scriv - - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - python3 -m scriv collect --version "${VERSION}" - - if git diff --quiet && git diff --cached --quiet; then - echo "::notice::scriv produced no CHANGELOG.md changes." - exit 0 - fi - - git add -A CHANGELOG.md changelog.d - # [skip ci] stops this changelog commit from retriggering release CI. - git commit -m "docs(changelog): collect fragments for ${VERSION} [skip ci]" - - # Prefer the PAT (passes branch protection); fall back to the workflow - # token. Push to an explicit authenticated URL so we don't depend on the - # checkout's persisted credentials. - TOKEN="${CHANGELOG_PAT:-$GITHUB_TOKEN}" - REMOTE="https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - - n=0 - until git push "${REMOTE}" "HEAD:${DEFAULT_BRANCH}" || [ "$n" -ge 4 ]; do - n=$((n + 1)) - echo "Retry $n/4 for changelog push..." - sleep $((2 ** n)) - git pull --rebase "${REMOTE}" "${DEFAULT_BRANCH}" - done - [ "$n" -lt 4 ] || { echo "::error::Failed to push CHANGELOG.md"; exit 1; } - echo "CHANGELOG.md updated for ${VERSION}" - - name: Create or update draft full release if: needs.detect-languages.outputs.auto-prerelease == 'true' && github.event_name != 'pull_request' env: @@ -1242,6 +1162,195 @@ jobs: echo "🎉 Floating tags updated successfully" # Final status check + # Changelog collection runs in its own job, after the release exists, so a + # failure here can never stop publish-github-packages or update-floating-tags. + # Until 2026-11-06 it was the last step of create-release, ahead of + # check-release: a rejected push failed the job before `release-created` was + # written, and both publish jobs skipped (audiobook-organizer v0.223.0). + collect-changelog: + name: Collect Changelog Fragments + runs-on: ubuntu-latest + timeout-minutes: 15 + needs: [detect-languages, create-release] + if: >- + always() && + needs.create-release.outputs.release-created == 'true' && + github.event_name != 'pull_request' && + inputs.changelog-collect != 'false' && + needs.detect-languages.outputs.auto-prerelease != 'true' + steps: + # The released commit, not the branch tip: collect exactly the fragments + # that shipped in this version. Fragments merged after it stay pending. + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + # Same guard as build-go: `if:` cannot read secrets.* in a workflow_call + # workflow, so materialise CI_APP_ID through env first. + - name: Check for App credentials + id: check-app + env: + CI_APP_ID: ${{ secrets.CI_APP_ID }} + run: | + if [ -n "$CI_APP_ID" ]; then + echo "have-app=true" >> "$GITHUB_OUTPUT" + else + echo "have-app=false" >> "$GITHUB_OUTPUT" + fi + + # Only used if the default branch refuses a direct push (a ruleset or + # merge queue with no bypass). A pull request opened with GITHUB_TOKEN + # starts no pull_request workflows, so its required checks would never + # report and it could never merge; one opened with an App token does. + - name: Mint App token for the changelog pull request + id: app-token + if: steps.check-app.outputs.have-app == 'true' + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + app-id: ${{ secrets.CI_APP_ID }} + private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} + + - name: Collect changelog fragments + env: + VERSION: ${{ needs.create-release.outputs.version }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + CHANGELOG_PAT: ${{ secrets.JF_CI_GH_PAT }} + APP_TOKEN: ${{ steps.app-token.outputs.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + + if [ -z "${VERSION:-}" ]; then + echo "::warning::No version resolved; skipping changelog collect." + exit 0 + fi + + if [ ! -f changelog.d/scriv.ini ]; then + echo "::notice::No changelog.d/scriv.ini; nothing to collect." + exit 0 + fi + + # Defensive: scriv needs a CHANGELOG.md carrying the insert marker. + # Skip cleanly if the repo has scriv.ini but no marker-bearing changelog. + if [ ! -f CHANGELOG.md ] || ! grep -q 'scriv-insert-here' CHANGELOG.md; then + echo "::warning::changelog.d/scriv.ini present but CHANGELOG.md lacks the scriv-insert-here marker; skipping collect." + exit 0 + fi + + # Only real fragments count — README.md, templates/ and scriv.ini don't. + # + # Do NOT write this as `find ... | grep -q .`. `grep -q` exits on the + # first match, closing the pipe; `find` then dies on EPIPE, and under + # `set -o pipefail` the pipeline reports FAILURE even though grep + # succeeded. The leading `!` therefore fires this "no fragments" + # branch precisely when there are MANY fragments — and it exit 0s, so + # the release stays green while collection is silently skipped. + # + # The trigger is a RACE, not a size threshold: `find` loses only if it + # is still writing when `grep` exits. A handful of fragments fit in a + # single write() that lands before grep is scheduled, so nothing goes + # wrong; hundreds mean many writes and grep almost always wins first. + # Note 36 KB is well under the 64 KB pipe buffer — a FULL buffer is + # not what breaks this. audiobook-organizer collected fine at 131 + # fragments, then silently skipped six releases at 675. + # `-print -quit` stops at the first hit and needs no pipeline at all. + if [ -z "$(find changelog.d -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit)" ]; then + echo "::notice::No changelog fragments to collect for ${VERSION}." + exit 0 + fi + + python3 -m pip install --quiet scriv + + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + python3 -m scriv collect --version "${VERSION}" + + if git diff --quiet && git diff --cached --quiet; then + echo "::notice::scriv produced no CHANGELOG.md changes." + exit 0 + fi + + git add -A CHANGELOG.md changelog.d + # [skip ci] stops this changelog commit from retriggering release CI. + git commit -m "docs(changelog): collect fragments for ${VERSION} [skip ci]" + + # 1. Direct push, as before, for repositories that allow it. Prefer the + # PAT, fall back to the workflow token. Push to an explicit + # authenticated URL; the checkout persists no credentials. + PUSH_TOKEN="${CHANGELOG_PAT:-$GITHUB_TOKEN}" + REMOTE="https://x-access-token:${PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + ERR="$(mktemp)" + n=0 + while :; do + if git push "${REMOTE}" "HEAD:${DEFAULT_BRANCH}" 2>"$ERR"; then + cat "$ERR" + echo "CHANGELOG.md updated for ${VERSION}" + exit 0 + fi + cat "$ERR" >&2 + # A ruleset or protection refusal is permanent; retrying cannot help. + if grep -qE 'GH013|GH006|protected branch|Repository rule violations' "$ERR"; then + break + fi + n=$((n + 1)) + if [ "$n" -ge 4 ]; then + echo "::error::Failed to push CHANGELOG.md after $n retries" + exit 1 + fi + echo "Retry $n/4 for changelog push..." + sleep $((2 ** n)) + git pull --rebase "${REMOTE}" "${DEFAULT_BRANCH}" + done + + # 2. The default branch refuses direct pushes: land the same commit + # through a pull request set to auto-merge, which a merge queue + # then takes. No [skip ci] here: the PR's required checks must run. + # "[skip changelog]" in the title exempts it from fragment checks. + echo "::notice::${DEFAULT_BRANCH} refuses direct pushes; opening a pull request instead." + TITLE="docs(changelog): collect fragments for ${VERSION} [skip changelog]" + git commit --amend -m "docs(changelog): collect fragments for ${VERSION}" + git fetch "${REMOTE}" "${DEFAULT_BRANCH}" + git rebase FETCH_HEAD + BRANCH="changelog/collect-${VERSION}" + + if [ -z "${APP_TOKEN:-}" ]; then + echo "::warning::CI_APP_ID is not configured. The changelog pull request is opened with a fallback token; if that is GITHUB_TOKEN, its pull_request checks will not start and it cannot merge until someone pushes to ${BRANCH}." + fi + + opened=false + for TOKEN in "${APP_TOKEN:-}" "${CHANGELOG_PAT:-}" "${GITHUB_TOKEN}"; do + [ -n "$TOKEN" ] || continue + export GH_TOKEN="$TOKEN" + if ! git push --force "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:refs/heads/${BRANCH}"; then + echo "::warning::Could not push ${BRANCH} with this token; trying the next one." + continue + fi + number="$(gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state open --json number --jq '.[0].number // empty' || true)" + if [ -z "$number" ]; then + if ! gh pr create --repo "$GITHUB_REPOSITORY" --base "$DEFAULT_BRANCH" --head "$BRANCH" \ + --title "$TITLE" \ + --body "Folds the changelog.d fragments released in ${VERSION} into CHANGELOG.md. Opened by the release workflow because ${DEFAULT_BRANCH} refuses direct pushes."; then + echo "::warning::Could not open the pull request with this token; trying the next one." + continue + fi + fi + opened=true + break + done + if [ "$opened" != true ]; then + echo "::error::Could not open the changelog pull request for ${VERSION} with any token." + exit 1 + fi + + if ! gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase --auto; then + echo "::error::Opened the changelog pull request for ${VERSION} but could not enable auto-merge; merge it by hand." + exit 1 + fi + echo "Changelog pull request for ${VERSION} is set to auto-merge." + build-status: name: Release Status Summary runs-on: ubuntu-latest diff --git a/changelog.d/20261106_changelog_collect_job_pr_fallback.md b/changelog.d/20261106_changelog_collect_job_pr_fallback.md new file mode 100644 index 00000000..00174fe6 --- /dev/null +++ b/changelog.d/20261106_changelog_collect_job_pr_fallback.md @@ -0,0 +1,22 @@ +### Fixed + +#### `reusable-release.yml`: changelog collection no longer blocks publishing, and lands through a PR when the default branch refuses pushes + +Changelog collection was the last step of `create-release`, ahead of the step +that writes `release-created`. When its push to the default branch was refused +(a ruleset or merge queue with no bypass: `GH013`), the job failed before that +output existed, so `publish-github-packages` and `update-floating-tags` were +skipped for a release that had been created with all its assets. + +- Collection is now its own job, `collect-changelog`, that runs after + `create-release` once the release exists. Its failure turns the run red but + cannot skip publishing. +- It still tries the direct push first, as before. On a protection or ruleset + refusal it stops retrying and opens a pull request from + `changelog/collect-` with auto-merge (rebase) enabled, which a merge + queue then takes. The PR is opened with the `CI_APP_ID` App token when + configured, since a PR opened with `GITHUB_TOKEN` starts no `pull_request` + checks and could never merge; it falls back to `JF_CI_GH_PAT`, then + `GITHUB_TOKEN`, with a warning. The PR commit drops `[skip ci]` and its title + carries `[skip changelog]`. +- It still collects only the fragments in the released commit. From 45518428f9142537bebb6dfe8dd34564b45b503f Mon Sep 17 00:00:00 2001 From: Johnathan Falk Date: Fri, 6 Nov 2026 10:07:58 -0500 Subject: [PATCH 2/4] fix(release): cherry-pick only the changelog commit, skip early, unblock floating tags Review of #388: update-floating-tags had no status function, so an implicit success() and the skipped build-* jobs skipped it on every release. Give it and collect-changelog !cancelled(). Collect: decide whether to collect before minting a token; skip a release not cut from the default branch; refuse while an earlier changelog PR is open; check the commit touches only the changelog; cherry-pick it onto a fresh fetch of the default branch for both the direct push and the PR; open the PR with the App token or the PAT only; fall back to a plain rebase merge when auto-merge cannot be enabled. build-status waits for the job. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011To9HQJLrCH6wYa5WCpw3L --- .github/workflows/reusable-release.yml | 209 +++++++++++------- ...61106_changelog_collect_job_pr_fallback.md | 37 ++-- 2 files changed, 150 insertions(+), 96 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 740b5e9e..3a64f8a5 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -776,10 +776,6 @@ jobs: ./artifacts/**/* token: ${{ secrets.GITHUB_TOKEN }} - # Assemble CHANGELOG.md from changelog.d/ fragments (scriv) and commit it - # back to the default branch. Opt-in by presence: only runs when the - # calling repo has changelog.d/scriv.ini (see changelog.d/README.md in - # falkcorp/github-common). No-op for every repo without that file. - name: Create or update draft full release if: needs.detect-languages.outputs.auto-prerelease == 'true' && github.event_name != 'pull_request' env: @@ -1088,7 +1084,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 needs: [detect-languages, create-release] + # `!cancelled()`: without a status function GitHub adds an implicit + # `success()`, and the often-skipped build-* jobs upstream skipped this job + # on every release, even successful ones (audiobook-organizer 2026-09-26). if: | + !cancelled() && needs.create-release.outputs.release-created == 'true' && needs.detect-languages.outputs.release-branch-strategy == 'stable' && !inputs.prerelease && @@ -1161,36 +1161,77 @@ jobs: echo "🎉 Floating tags updated successfully" - # Final status check # Changelog collection runs in its own job, after the release exists, so a # failure here can never stop publish-github-packages or update-floating-tags. # Until 2026-11-06 it was the last step of create-release, ahead of # check-release: a rejected push failed the job before `release-created` was # written, and both publish jobs skipped (audiobook-organizer v0.223.0). + # + # Opt-in by presence: only collects when the calling repo has + # changelog.d/scriv.ini (see changelog.d/README.md in falkcorp/github-common). + # + # `!cancelled()`, not `always()`: the upstream build-* jobs are often skipped, + # and a job-level `if:` without a status function gets an implicit + # `success()` that would skip this job too; `!cancelled()` avoids that and + # still honours a cancelled run. collect-changelog: name: Collect Changelog Fragments runs-on: ubuntu-latest timeout-minutes: 15 needs: [detect-languages, create-release] if: >- - always() && + !cancelled() && needs.create-release.outputs.release-created == 'true' && github.event_name != 'pull_request' && inputs.changelog-collect != 'false' && needs.detect-languages.outputs.auto-prerelease != 'true' steps: - # The released commit, not the branch tip: collect exactly the fragments - # that shipped in this version. Fragments merged after it stay pending. + # The released commit (github.sha), so exactly the fragments that shipped + # in this version are collected; fragments merged after it stay pending. - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false + # Every cheap reason to skip, before a token is minted or anything pushed. + - name: Decide whether to collect + id: plan + env: + VERSION: ${{ needs.create-release.outputs.version }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + REF_NAME: ${{ github.ref_name }} + run: | + set -euo pipefail + collect=false + if [ -z "${VERSION:-}" ]; then + echo "::warning::No version resolved; skipping changelog collect." + elif [ "$REF_NAME" != "$DEFAULT_BRANCH" ]; then + # The commit is cherry-picked onto the default branch below, so a + # release cut from another branch would carry nothing else across, + # but its fragments are not the default branch's to collect. + echo "::warning::Released from '${REF_NAME}', not '${DEFAULT_BRANCH}'; skipping changelog collect." + elif [ ! -f changelog.d/scriv.ini ]; then + echo "::notice::No changelog.d/scriv.ini; nothing to collect." + elif [ ! -f CHANGELOG.md ] || ! grep -q 'scriv-insert-here' CHANGELOG.md; then + echo "::warning::changelog.d/scriv.ini present but CHANGELOG.md lacks the scriv-insert-here marker; skipping collect." + # Only real fragments count -- README.md, templates/ and scriv.ini don't. + # Never `find ... | grep -q .`: grep exits on the first match, find dies + # on EPIPE, and pipefail reports failure exactly when there are MANY + # fragments (audiobook-organizer silently skipped six releases at 675). + # `-print -quit` stops at the first hit and needs no pipeline. + elif [ -z "$(find changelog.d -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit)" ]; then + echo "::notice::No changelog fragments to collect for ${VERSION}." + else + collect=true + fi + echo "collect=${collect}" >> "$GITHUB_OUTPUT" + # Same guard as build-go: `if:` cannot read secrets.* in a workflow_call # workflow, so materialise CI_APP_ID through env first. - name: Check for App credentials id: check-app + if: steps.plan.outputs.collect == 'true' env: CI_APP_ID: ${{ secrets.CI_APP_ID }} run: | @@ -1200,19 +1241,20 @@ jobs: echo "have-app=false" >> "$GITHUB_OUTPUT" fi - # Only used if the default branch refuses a direct push (a ruleset or + # Used only if the default branch refuses a direct push (a ruleset or a # merge queue with no bypass). A pull request opened with GITHUB_TOKEN # starts no pull_request workflows, so its required checks would never - # report and it could never merge; one opened with an App token does. + # report; one opened with an App token (or a user PAT) does. - name: Mint App token for the changelog pull request id: app-token - if: steps.check-app.outputs.have-app == 'true' + if: steps.plan.outputs.collect == 'true' && steps.check-app.outputs.have-app == 'true' uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 with: app-id: ${{ secrets.CI_APP_ID }} private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} - name: Collect changelog fragments + if: steps.plan.outputs.collect == 'true' env: VERSION: ${{ needs.create-release.outputs.version }} DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} @@ -1221,44 +1263,20 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail + BRANCH="changelog/collect-${VERSION}" - if [ -z "${VERSION:-}" ]; then - echo "::warning::No version resolved; skipping changelog collect." - exit 0 - fi - - if [ ! -f changelog.d/scriv.ini ]; then - echo "::notice::No changelog.d/scriv.ini; nothing to collect." - exit 0 - fi - - # Defensive: scriv needs a CHANGELOG.md carrying the insert marker. - # Skip cleanly if the repo has scriv.ini but no marker-bearing changelog. - if [ ! -f CHANGELOG.md ] || ! grep -q 'scriv-insert-here' CHANGELOG.md; then - echo "::warning::changelog.d/scriv.ini present but CHANGELOG.md lacks the scriv-insert-here marker; skipping collect." - exit 0 - fi - - # Only real fragments count — README.md, templates/ and scriv.ini don't. - # - # Do NOT write this as `find ... | grep -q .`. `grep -q` exits on the - # first match, closing the pipe; `find` then dies on EPIPE, and under - # `set -o pipefail` the pipeline reports FAILURE even though grep - # succeeded. The leading `!` therefore fires this "no fragments" - # branch precisely when there are MANY fragments — and it exit 0s, so - # the release stays green while collection is silently skipped. - # - # The trigger is a RACE, not a size threshold: `find` loses only if it - # is still writing when `grep` exits. A handful of fragments fit in a - # single write() that lands before grep is scheduled, so nothing goes - # wrong; hundreds mean many writes and grep almost always wins first. - # Note 36 KB is well under the 64 KB pipe buffer — a FULL buffer is - # not what breaks this. audiobook-organizer collected fine at 131 - # fragments, then silently skipped six releases at 675. - # `-print -quit` stops at the first hit and needs no pipeline at all. - if [ -z "$(find changelog.d -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit)" ]; then - echo "::notice::No changelog fragments to collect for ${VERSION}." - exit 0 + # An earlier release's changelog PR that has not merged yet still + # leaves its fragments in this checkout; collecting now would file + # them under this version too. Refuse instead (needs a token that can + # read pull requests; GITHUB_TOKEN usually cannot, so skip if absent). + LIST_TOKEN="${APP_TOKEN:-${CHANGELOG_PAT:-}}" + if [ -n "$LIST_TOKEN" ]; then + pending="$(GH_TOKEN="$LIST_TOKEN" gh pr list --repo "$GITHUB_REPOSITORY" --state open \ + --json headRefName --jq '[.[] | select(.headRefName | startswith("changelog/collect-")) | .headRefName] | join(" ")')" + if [ -n "$pending" ]; then + echo "::error::Changelog pull request(s) still open: ${pending}. Merge or close them, then re-run this job; collecting now would file their fragments under ${VERSION} as well." + exit 1 + fi fi python3 -m pip install --quiet scriv @@ -1274,25 +1292,42 @@ jobs: fi git add -A CHANGELOG.md changelog.d - # [skip ci] stops this changelog commit from retriggering release CI. + # [skip ci] stops a directly pushed changelog commit from retriggering + # release CI. The pull-request path below removes it. git commit -m "docs(changelog): collect fragments for ${VERSION} [skip ci]" + COMMIT="$(git rev-parse HEAD)" + + # Only the changelog may travel. Anything else means scriv or the + # checkout did something unexpected; never push it. + other="$(git diff --name-only "${COMMIT}^" "${COMMIT}" | grep -vE '^(CHANGELOG\.md|changelog\.d/)' || true)" + if [ -n "$other" ]; then + echo "::error::The changelog commit touches files outside CHANGELOG.md and changelog.d/: ${other}" + exit 1 + fi + + # Put the one changelog commit on a fresh copy of the default branch's + # tip. Never push the checkout's own history. + land_on_tip() { + git fetch --quiet "https://x-access-token:${1}@github.com/${GITHUB_REPOSITORY}.git" "${DEFAULT_BRANCH}" + git checkout --quiet --detach FETCH_HEAD + git cherry-pick "${COMMIT}" + } # 1. Direct push, as before, for repositories that allow it. Prefer the - # PAT, fall back to the workflow token. Push to an explicit - # authenticated URL; the checkout persists no credentials. + # PAT, fall back to the workflow token. PUSH_TOKEN="${CHANGELOG_PAT:-$GITHUB_TOKEN}" - REMOTE="https://x-access-token:${PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" ERR="$(mktemp)" n=0 while :; do - if git push "${REMOTE}" "HEAD:${DEFAULT_BRANCH}" 2>"$ERR"; then + land_on_tip "$PUSH_TOKEN" + if git push "https://x-access-token:${PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:${DEFAULT_BRANCH}" 2>"$ERR"; then cat "$ERR" echo "CHANGELOG.md updated for ${VERSION}" exit 0 fi cat "$ERR" >&2 - # A ruleset or protection refusal is permanent; retrying cannot help. - if grep -qE 'GH013|GH006|protected branch|Repository rule violations' "$ERR"; then + # A protection or ruleset refusal is permanent; retrying cannot help. + if grep -qiE 'GH013|GH006|protected branch|Repository rule violations' "$ERR"; then break fi n=$((n + 1)) @@ -1302,55 +1337,62 @@ jobs: fi echo "Retry $n/4 for changelog push..." sleep $((2 ** n)) - git pull --rebase "${REMOTE}" "${DEFAULT_BRANCH}" done # 2. The default branch refuses direct pushes: land the same commit - # through a pull request set to auto-merge, which a merge queue - # then takes. No [skip ci] here: the PR's required checks must run. - # "[skip changelog]" in the title exempts it from fragment checks. + # through a pull request, set to merge as soon as its required checks + # pass (a merge queue then takes it). No [skip ci]: the PR's checks + # must run. "[skip changelog]" in the title exempts it from + # fragment-required checks. Only the App token or the PAT can open + # it: a GITHUB_TOKEN-opened PR starts no checks and could not merge. echo "::notice::${DEFAULT_BRANCH} refuses direct pushes; opening a pull request instead." TITLE="docs(changelog): collect fragments for ${VERSION} [skip changelog]" - git commit --amend -m "docs(changelog): collect fragments for ${VERSION}" - git fetch "${REMOTE}" "${DEFAULT_BRANCH}" - git rebase FETCH_HEAD - BRANCH="changelog/collect-${VERSION}" + BODY="Folds the changelog.d fragments released in ${VERSION} into CHANGELOG.md. Opened by the release workflow because ${DEFAULT_BRANCH} refuses direct pushes." - if [ -z "${APP_TOKEN:-}" ]; then - echo "::warning::CI_APP_ID is not configured. The changelog pull request is opened with a fallback token; if that is GITHUB_TOKEN, its pull_request checks will not start and it cannot merge until someone pushes to ${BRANCH}." - fi - - opened=false - for TOKEN in "${APP_TOKEN:-}" "${CHANGELOG_PAT:-}" "${GITHUB_TOKEN}"; do - [ -n "$TOKEN" ] || continue - export GH_TOKEN="$TOKEN" + opened="" + for kind in app pat; do + if [ "$kind" = app ]; then TOKEN="${APP_TOKEN:-}"; else TOKEN="${CHANGELOG_PAT:-}"; fi + if [ -z "$TOKEN" ]; then + echo "::notice::No ${kind} token configured." + continue + fi + land_on_tip "$TOKEN" + git commit --quiet --amend -m "docs(changelog): collect fragments for ${VERSION}" if ! git push --force "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:refs/heads/${BRANCH}"; then - echo "::warning::Could not push ${BRANCH} with this token; trying the next one." + echo "::warning::Could not push ${BRANCH} with the ${kind} token; trying the next one." continue fi - number="$(gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state open --json number --jq '.[0].number // empty' || true)" - if [ -z "$number" ]; then + export GH_TOKEN="$TOKEN" + if [ -z "$(gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state open --json number --jq '.[0].number // empty' || true)" ]; then if ! gh pr create --repo "$GITHUB_REPOSITORY" --base "$DEFAULT_BRANCH" --head "$BRANCH" \ - --title "$TITLE" \ - --body "Folds the changelog.d fragments released in ${VERSION} into CHANGELOG.md. Opened by the release workflow because ${DEFAULT_BRANCH} refuses direct pushes."; then - echo "::warning::Could not open the pull request with this token; trying the next one." + --title "$TITLE" --body "$BODY"; then + echo "::warning::Could not open the pull request with the ${kind} token; trying the next one." continue fi fi - opened=true + opened="$kind" break done - if [ "$opened" != true ]; then - echo "::error::Could not open the changelog pull request for ${VERSION} with any token." + if [ -z "$opened" ]; then + echo "::error::Could not open the changelog pull request for ${VERSION}: set CI_APP_ID/CI_APP_PRIVATE_KEY (App with contents and pull-requests write) or JF_CI_GH_PAT." exit 1 fi + if [ "$opened" = pat ] && [ -n "${APP_TOKEN:-}" ]; then + echo "::warning::The App token could not open the pull request (does the App have pull-requests write?); it was opened with JF_CI_GH_PAT." + fi - if ! gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase --auto; then - echo "::error::Opened the changelog pull request for ${VERSION} but could not enable auto-merge; merge it by hand." + # Auto-merge needs allow_auto_merge and something still pending. If it + # cannot be enabled, merge now: on a merge-queue branch that enqueues. + if gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase --auto; then + echo "::notice::Changelog pull request for ${VERSION} will merge once its required checks pass." + elif gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase; then + echo "::notice::Changelog pull request for ${VERSION} merged (or entered the merge queue)." + else + echo "::error::Opened the changelog pull request for ${VERSION} (${BRANCH}) but could neither enable auto-merge nor merge it; merge it by hand." exit 1 fi - echo "Changelog pull request for ${VERSION} is set to auto-merge." + # Final status check build-status: name: Release Status Summary runs-on: ubuntu-latest @@ -1365,6 +1407,7 @@ jobs: create-release, publish-github-packages, update-floating-tags, + collect-changelog, ] if: always() outputs: diff --git a/changelog.d/20261106_changelog_collect_job_pr_fallback.md b/changelog.d/20261106_changelog_collect_job_pr_fallback.md index 00174fe6..2a9f4457 100644 --- a/changelog.d/20261106_changelog_collect_job_pr_fallback.md +++ b/changelog.d/20261106_changelog_collect_job_pr_fallback.md @@ -1,6 +1,6 @@ ### Fixed -#### `reusable-release.yml`: changelog collection no longer blocks publishing, and lands through a PR when the default branch refuses pushes +#### `reusable-release.yml`: changelog collection no longer blocks publishing, lands through a PR when the default branch refuses pushes, and floating tags move again Changelog collection was the last step of `create-release`, ahead of the step that writes `release-created`. When its push to the default branch was refused @@ -8,15 +8,26 @@ that writes `release-created`. When its push to the default branch was refused output existed, so `publish-github-packages` and `update-floating-tags` were skipped for a release that had been created with all its assets. -- Collection is now its own job, `collect-changelog`, that runs after - `create-release` once the release exists. Its failure turns the run red but - cannot skip publishing. -- It still tries the direct push first, as before. On a protection or ruleset - refusal it stops retrying and opens a pull request from - `changelog/collect-` with auto-merge (rebase) enabled, which a merge - queue then takes. The PR is opened with the `CI_APP_ID` App token when - configured, since a PR opened with `GITHUB_TOKEN` starts no `pull_request` - checks and could never merge; it falls back to `JF_CI_GH_PAT`, then - `GITHUB_TOKEN`, with a warning. The PR commit drops `[skip ci]` and its title - carries `[skip changelog]`. -- It still collects only the fragments in the released commit. +- Collection is now its own job, `collect-changelog`, after `create-release`. + Its failure turns the run red but cannot skip publishing. `build-status` waits + for it. +- A first step decides whether there is anything to collect (the release is from + the default branch, `changelog.d/scriv.ini` and the CHANGELOG marker exist, + fragments are pending) before any token is minted. +- It collects at the released commit and checks the commit touches only + `CHANGELOG.md` and `changelog.d/`, then cherry-picks that one commit onto a + fresh fetch of the default branch. The old step pushed (or rebased) the + checkout's own history, so a release cut from another branch could carry + that branch's commits to the default branch. +- It still tries the direct push first. On a protection or ruleset refusal it + opens a pull request from `changelog/collect-` with the `CI_APP_ID` + App token, or `JF_CI_GH_PAT` if the App cannot, and enables rebase auto-merge + (falling back to a plain rebase merge, which enqueues on a merge-queue + branch). A PR opened with `GITHUB_TOKEN` starts no checks, so that token is + not used for it. The PR commit drops `[skip ci]`; its title carries + `[skip changelog]`. +- It refuses to collect while an earlier `changelog/collect-*` PR is still open, + so fragments are never filed under two versions. +- `update-floating-tags` gains `!cancelled()`. Without a status function GitHub + applied an implicit `success()`, and the often-skipped `build-*` jobs upstream + skipped it on every release, successful ones included. From 01dd003c5e6203840e40751f3014b8c51fc4eb5f Mon Sep 17 00:00:00 2001 From: Johnathan Falk Date: Fri, 6 Nov 2026 10:09:53 -0500 Subject: [PATCH 3/4] fix(release): merge the changelog PR by number, same-repo only, pinned to the pushed commit gh pr merge resolves by head name, which a fork PR can share. Look the PR up with isCrossRepository == false, merge it by number with --match-head-commit, and filter the pending-PR guard the same way. The plain-merge fallback stays (it never passes --admin) but is pinned the same way. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011To9HQJLrCH6wYa5WCpw3L --- .github/workflows/reusable-release.yml | 38 ++++++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 3a64f8a5..e05d5e35 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -1272,7 +1272,8 @@ jobs: LIST_TOKEN="${APP_TOKEN:-${CHANGELOG_PAT:-}}" if [ -n "$LIST_TOKEN" ]; then pending="$(GH_TOKEN="$LIST_TOKEN" gh pr list --repo "$GITHUB_REPOSITORY" --state open \ - --json headRefName --jq '[.[] | select(.headRefName | startswith("changelog/collect-")) | .headRefName] | join(" ")')" + --json headRefName,isCrossRepository \ + --jq '[.[] | select(.isCrossRepository == false and (.headRefName | startswith("changelog/collect-"))) | .headRefName] | join(" ")')" if [ -n "$pending" ]; then echo "::error::Changelog pull request(s) still open: ${pending}. Merge or close them, then re-run this job; collecting now would file their fragments under ${VERSION} as well." exit 1 @@ -1350,6 +1351,15 @@ jobs: BODY="Folds the changelog.d fragments released in ${VERSION} into CHANGELOG.md. Opened by the release workflow because ${DEFAULT_BRANCH} refuses direct pushes." opened="" + PR="" + HEAD_SHA="" + # The same-repository PR for BRANCH, by number. Never resolve a PR by + # branch name alone: a fork can open one with the same head name. + own_pr() { + gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state open \ + --json number,isCrossRepository \ + --jq '[.[] | select(.isCrossRepository == false)][0].number // empty' || true + } for kind in app pat; do if [ "$kind" = app ]; then TOKEN="${APP_TOKEN:-}"; else TOKEN="${CHANGELOG_PAT:-}"; fi if [ -z "$TOKEN" ]; then @@ -1358,17 +1368,24 @@ jobs: fi land_on_tip "$TOKEN" git commit --quiet --amend -m "docs(changelog): collect fragments for ${VERSION}" + HEAD_SHA="$(git rev-parse HEAD)" if ! git push --force "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:refs/heads/${BRANCH}"; then echo "::warning::Could not push ${BRANCH} with the ${kind} token; trying the next one." continue fi export GH_TOKEN="$TOKEN" - if [ -z "$(gh pr list --repo "$GITHUB_REPOSITORY" --head "$BRANCH" --state open --json number --jq '.[0].number // empty' || true)" ]; then + PR="$(own_pr)" + if [ -z "$PR" ]; then if ! gh pr create --repo "$GITHUB_REPOSITORY" --base "$DEFAULT_BRANCH" --head "$BRANCH" \ --title "$TITLE" --body "$BODY"; then echo "::warning::Could not open the pull request with the ${kind} token; trying the next one." continue fi + PR="$(own_pr)" + fi + if [ -z "$PR" ]; then + echo "::warning::Opened ${BRANCH} but cannot find its pull request with the ${kind} token; trying the next one." + continue fi opened="$kind" break @@ -1381,14 +1398,17 @@ jobs: echo "::warning::The App token could not open the pull request (does the App have pull-requests write?); it was opened with JF_CI_GH_PAT." fi - # Auto-merge needs allow_auto_merge and something still pending. If it - # cannot be enabled, merge now: on a merge-queue branch that enqueues. - if gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase --auto; then - echo "::notice::Changelog pull request for ${VERSION} will merge once its required checks pass." - elif gh pr merge --repo "$GITHUB_REPOSITORY" "$BRANCH" --rebase; then - echo "::notice::Changelog pull request for ${VERSION} merged (or entered the merge queue)." + # Merge by number, pinned to the commit pushed above. Auto-merge needs + # allow_auto_merge and something still pending; if it cannot be + # enabled, merge now (on a merge-queue branch that enqueues). Never + # --admin: required checks, reviews and the queue still apply, and the + # commit was checked above to touch only the changelog. + if gh pr merge "$PR" --repo "$GITHUB_REPOSITORY" --rebase --auto --match-head-commit "$HEAD_SHA"; then + echo "::notice::Changelog pull request #${PR} for ${VERSION} will merge once its required checks pass." + elif gh pr merge "$PR" --repo "$GITHUB_REPOSITORY" --rebase --match-head-commit "$HEAD_SHA"; then + echo "::notice::Changelog pull request #${PR} for ${VERSION} merged (or entered the merge queue)." else - echo "::error::Opened the changelog pull request for ${VERSION} (${BRANCH}) but could neither enable auto-merge nor merge it; merge it by hand." + echo "::error::Opened changelog pull request #${PR} for ${VERSION} but could neither enable auto-merge nor merge it; merge it by hand." exit 1 fi From 594d17f3fbf21fc62f99dc953df8d79aa19cd8cc Mon Sep 17 00:00:00 2001 From: Johnathan Falk Date: Fri, 6 Nov 2026 10:13:07 -0500 Subject: [PATCH 4/4] fix(release): collect when the released commit is on the default branch; leave floating tags alone Re-review of #388. Comparing github.ref_name to the default branch skipped every tag-push release (burndown-runner-image), so test ancestry instead. The pending-PR guard lists up to 1000 PRs, skips this version's own branch so a re-run reuses its PR, and only warns when the token cannot list PRs. Revert the !cancelled() on update-floating-tags: the job has never run for callers with skipped build-* jobs, and turning it on makes annotated v0/v0.N tags on the release commit that git describe prefers over vX.Y.Z (audiobook-organizer stamps builds from git describe). Whether floating tags become an input is a separate decision. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011To9HQJLrCH6wYa5WCpw3L --- .github/workflows/reusable-release.yml | 28 +++++++++++-------- ...61106_changelog_collect_job_pr_fallback.md | 19 ++++++------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index e05d5e35..96ae84b2 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -1084,11 +1084,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 needs: [detect-languages, create-release] - # `!cancelled()`: without a status function GitHub adds an implicit - # `success()`, and the often-skipped build-* jobs upstream skipped this job - # on every release, even successful ones (audiobook-organizer 2026-09-26). if: | - !cancelled() && needs.create-release.outputs.release-created == 'true' && needs.detect-languages.outputs.release-branch-strategy == 'stable' && !inputs.prerelease && @@ -1200,17 +1196,19 @@ jobs: env: VERSION: ${{ needs.create-release.outputs.version }} DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} - REF_NAME: ${{ github.ref_name }} run: | set -euo pipefail collect=false if [ -z "${VERSION:-}" ]; then echo "::warning::No version resolved; skipping changelog collect." - elif [ "$REF_NAME" != "$DEFAULT_BRANCH" ]; then - # The commit is cherry-picked onto the default branch below, so a - # release cut from another branch would carry nothing else across, - # but its fragments are not the default branch's to collect. - echo "::warning::Released from '${REF_NAME}', not '${DEFAULT_BRANCH}'; skipping changelog collect." + # Only the default branch's fragments belong in its CHANGELOG.md. Test + # ancestry, not github.ref_name: a tag-push release has the tag as its + # ref name, and a tag on the default branch must still collect. (Only + # the changelog commit is ever cherry-picked across, so a release cut + # elsewhere could not carry other commits; it simply has nothing to + # collect here.) + elif ! git merge-base --is-ancestor "$GITHUB_SHA" "origin/${DEFAULT_BRANCH}"; then + echo "::warning::${GITHUB_SHA} is not on ${DEFAULT_BRANCH}; skipping changelog collect." elif [ ! -f changelog.d/scriv.ini ]; then echo "::notice::No changelog.d/scriv.ini; nothing to collect." elif [ ! -f CHANGELOG.md ] || ! grep -q 'scriv-insert-here' CHANGELOG.md; then @@ -1269,11 +1267,17 @@ jobs: # leaves its fragments in this checkout; collecting now would file # them under this version too. Refuse instead (needs a token that can # read pull requests; GITHUB_TOKEN usually cannot, so skip if absent). + # This version's own branch is excluded: a re-run reuses its PR. LIST_TOKEN="${APP_TOKEN:-${CHANGELOG_PAT:-}}" if [ -n "$LIST_TOKEN" ]; then - pending="$(GH_TOKEN="$LIST_TOKEN" gh pr list --repo "$GITHUB_REPOSITORY" --state open \ + if ! pending="$(GH_TOKEN="$LIST_TOKEN" gh pr list --repo "$GITHUB_REPOSITORY" --state open --limit 1000 \ --json headRefName,isCrossRepository \ - --jq '[.[] | select(.isCrossRepository == false and (.headRefName | startswith("changelog/collect-"))) | .headRefName] | join(" ")')" + --jq "[.[] | select(.isCrossRepository == false and (.headRefName | startswith(\"changelog/collect-\")) and .headRefName != \"${BRANCH}\") | .headRefName] | join(\" \")")"; then + # Repos that push directly never have such a PR; do not fail + # their release because this token cannot read pull requests. + echo "::warning::Could not list open pull requests; not checking for an earlier unmerged changelog PR." + pending="" + fi if [ -n "$pending" ]; then echo "::error::Changelog pull request(s) still open: ${pending}. Merge or close them, then re-run this job; collecting now would file their fragments under ${VERSION} as well." exit 1 diff --git a/changelog.d/20261106_changelog_collect_job_pr_fallback.md b/changelog.d/20261106_changelog_collect_job_pr_fallback.md index 2a9f4457..6e2c7beb 100644 --- a/changelog.d/20261106_changelog_collect_job_pr_fallback.md +++ b/changelog.d/20261106_changelog_collect_job_pr_fallback.md @@ -1,18 +1,18 @@ ### Fixed -#### `reusable-release.yml`: changelog collection no longer blocks publishing, lands through a PR when the default branch refuses pushes, and floating tags move again +#### `reusable-release.yml`: changelog collection no longer blocks publishing, and lands through a PR when the default branch refuses pushes Changelog collection was the last step of `create-release`, ahead of the step that writes `release-created`. When its push to the default branch was refused (a ruleset or merge queue with no bypass: `GH013`), the job failed before that -output existed, so `publish-github-packages` and `update-floating-tags` were -skipped for a release that had been created with all its assets. +output existed, so `publish-github-packages` was skipped for a release that had +been created with all its assets. - Collection is now its own job, `collect-changelog`, after `create-release`. Its failure turns the run red but cannot skip publishing. `build-status` waits for it. -- A first step decides whether there is anything to collect (the release is from - the default branch, `changelog.d/scriv.ini` and the CHANGELOG marker exist, +- A first step decides whether there is anything to collect (the released + commit is on the default branch, which a tag-push release also passes, `changelog.d/scriv.ini` and the CHANGELOG marker exist, fragments are pending) before any token is minted. - It collects at the released commit and checks the commit touches only `CHANGELOG.md` and `changelog.d/`, then cherry-picks that one commit onto a @@ -26,8 +26,7 @@ skipped for a release that had been created with all its assets. branch). A PR opened with `GITHUB_TOKEN` starts no checks, so that token is not used for it. The PR commit drops `[skip ci]`; its title carries `[skip changelog]`. -- It refuses to collect while an earlier `changelog/collect-*` PR is still open, - so fragments are never filed under two versions. -- `update-floating-tags` gains `!cancelled()`. Without a status function GitHub - applied an implicit `success()`, and the often-skipped `build-*` jobs upstream - skipped it on every release, successful ones included. +- It refuses to collect while an earlier version's `changelog/collect-*` PR is + still open, so fragments are never filed under two versions. A re-run of the + same version reuses its own PR, and a token that cannot list pull requests + only warns, so repos that push directly are unaffected.