From 1bb41272c64e16e1fc6f641d87e91548d0b1f6e9 Mon Sep 17 00:00:00 2001 From: so0k Date: Sat, 4 Jul 2026 17:26:40 +0800 Subject: [PATCH 1/2] fix(gha): flip merged release PR label to autorelease: tagged release-please-config.json sets skip-github-release: true so the release.yml stable job (not release-please) creates the tag/GitHub Release. Release-please never sees that as "finalized" and leaves the merged release PR labeled autorelease: pending forever, which makes it permanently refuse to open the next release PR ("There are untagged, merged release PRs outstanding - aborting"). Have the release_github job relabel the merged PR to autorelease: tagged right after it creates the GitHub release, so release-please's own bookkeeping matches reality. --- .github/workflows/release.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a41042c2..911dc2b54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -320,6 +320,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + pull-requests: write needs: - prepare-release - integration_test @@ -347,6 +348,23 @@ jobs: run: pnpm run release-github env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Mark merged release PR as tagged + # skip-github-release in release-please-config.json means release-please + # never sees this release finalized, so it never flips the merged release + # PR's label from "autorelease: pending" to "autorelease: tagged" itself. + # Without this, release-please permanently refuses to open the next + # release PR ("There are untagged, merged release PRs outstanding"). + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + pr=$(gh api "repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" --jq '.[0].number // empty') + if [ -z "${pr}" ]; then + echo "No pull request associated with ${{ github.sha }}, skipping relabel" + exit 0 + fi + gh label create "autorelease: tagged" --color 0E8A16 \ + --description "This PR represents a release that has been tagged and published" 2>/dev/null || true + gh pr edit "${pr}" --remove-label "autorelease: pending" --add-label "autorelease: tagged" publish_release: permissions: From f58523ece836755642ec4f9ae5dd38a0e8e0c284 Mon Sep 17 00:00:00 2001 From: so0k Date: Sat, 4 Jul 2026 17:57:05 +0800 Subject: [PATCH 2/2] fix(gha): don't recreate the autorelease: tagged label every run The label is a one-time, repo-wide fixture (already created), so attempting to create it on every release was unnecessary. Addressed feedback: https://github.com/open-constructs/cdk-terrain/pull/302/changes#r3522958993 --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 911dc2b54..b24f4c0e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -354,6 +354,7 @@ jobs: # PR's label from "autorelease: pending" to "autorelease: tagged" itself. # Without this, release-please permanently refuses to open the next # release PR ("There are untagged, merged release PRs outstanding"). + # The "autorelease: tagged" label itself is created once, repo-wide. env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -362,8 +363,6 @@ jobs: echo "No pull request associated with ${{ github.sha }}, skipping relabel" exit 0 fi - gh label create "autorelease: tagged" --color 0E8A16 \ - --description "This PR represents a release that has been tagged and published" 2>/dev/null || true gh pr edit "${pr}" --remove-label "autorelease: pending" --add-label "autorelease: tagged" publish_release: