From ce70ccc6cbf4b9b9ca084d8bb007ddf07c34e172 Mon Sep 17 00:00:00 2001 From: InstaZDLL Date: Mon, 4 May 2026 23:55:59 +0200 Subject: [PATCH] ci(release-please): unlock locked release PR before commenting Locked release-please PRs make the action exit non-zero when it tries to post the post-merge tagged comment, even though the tag and the GitHub release are already created. Add a pre-step that detects the latest release PR via gh search, checks its locked state, and unlocks it so release-please can finish its cycle cleanly. --- .github/workflows/release-please.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5af491b..120122b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -27,6 +27,31 @@ jobs: tag_name: ${{ steps.resolve.outputs.tag_name }} steps: + - name: Unlock latest release-please PR if locked + if: github.event_name == 'push' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + pr_num=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --state all \ + --search '"chore(main): release" in:title sort:created-desc' \ + --limit 1 \ + --json number \ + --jq '.[0].number // empty') + if [ -z "$pr_num" ]; then + echo "No release-please PR found, nothing to unlock." + exit 0 + fi + is_locked=$(gh api "repos/$GITHUB_REPOSITORY/issues/$pr_num" --jq '.locked') + if [ "$is_locked" = "true" ]; then + echo "Unlocking PR #$pr_num so release-please can post its tagged comment." + gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$pr_num/lock" + else + echo "PR #$pr_num is already unlocked." + fi + - name: Run Release Please id: release if: github.event_name == 'push'