diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df17a68..1d284cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,7 +110,23 @@ jobs: --title "chore(release): v${version}" \ --body "Automated release PR generated by \`.github/workflows/release.yml\`. Bumps every version-bearing manifest to v${version}.") echo "Created release PR: $pr_url" - gh pr merge "$pr_url" --squash --delete-branch + + # `gh pr create` returns synchronously but GraphQL's PR node + # is eventually consistent — the v1.0.4 release hit a race + # where `gh pr merge` fired ~500ms after create and got: + # "Could not resolve to a PullRequest with the number of N" + # Retry up to 5 times with a 2s backoff to cover propagation. + for attempt in 1 2 3 4 5; do + if gh pr merge "$pr_url" --squash --delete-branch; then + break + fi + if [ "$attempt" = "5" ]; then + echo "::error::gh pr merge still failing after 5 attempts" + exit 1 + fi + echo "gh pr merge attempt $attempt failed (likely GraphQL lag); retrying in 2s..." + sleep 2 + done - name: Tag the merged commit on main run: |