From 660db0e6f7c61d238aae241e152cf32a17241d0f Mon Sep 17 00:00:00 2001 From: Eric Viana Date: Mon, 3 Aug 2026 21:16:41 -0300 Subject: [PATCH] chore(ci): take the release PR number from release-please's output Listing by label raced GitHub's indexing: the previous run created the release PR at 00:14:03 and a label query 3 seconds later returned nothing, so 3.1.1 sat open. The action's own output is immediate; the label query stays as a retried fallback. Claude-Session: https://claude.ai/code/session_01F1stiNzuNtJXoXtiW9ZCbs --- .github/workflows/publish.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 84b0133..3ae9300 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -39,9 +39,22 @@ jobs: - name: Merge the release PR env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_PR: ${{ steps.release.outputs.pr }} run: | - PR=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --label 'autorelease: pending' \ - --json number,author --jq '[.[] | select(.author.is_bot)] | .[0].number // empty') + # The action's own output is authoritative and immediate. Listing by + # label is not: the previous run created PR #61 at 00:14:03 and a + # label query 3 seconds later still returned nothing, so the release + # sat open. + PR=$(printf '%s' "$RELEASE_PR" | jq -r '.number // empty' 2>/dev/null || true) + + if [ -z "$PR" ]; then + for _ in 1 2 3; do + PR=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --label 'autorelease: pending' \ + --json number,author --jq '[.[] | select(.author.is_bot)] | .[0].number // empty') + [ -n "$PR" ] && break + sleep 5 + done + fi if [ -z "$PR" ]; then echo "No pending release PR to merge."