ci: fix release pipeline race condition in PR lookup after squash merge#4
Merged
Merged
Conversation
Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate skipped steps in CI pipeline
ci: fix release pipeline race condition in PR lookup after squash merge
Mar 8, 2026
nilsandrey
marked this pull request as ready for review
March 8, 2026 17:38
There was a problem hiding this comment.
Pull request overview
This PR improves the GitHub Actions release workflow’s ability to reliably find the merged PR associated with a push to main, addressing GitHub’s delayed commit→PR indexing after squash merges so releases aren’t skipped.
Changes:
- Add retry logic with increasing delays for the
commits/{sha}/pullsPR lookup. - Add a commit-subject fallback that extracts
(#N)and fetches the PR directly when the commits/pulls lookup remains empty.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix release pipeline race condition: add retry logic and commit-message fallback for PR lookup after squash merges.
Problem
PR #3's squash merge triggered the release workflow within 3 seconds. The
gh api commits/{sha}/pullscall returned empty — GitHub hadn't indexed the commit→PR association yet. This setbump_type=none, skipping all release steps (version bump, changelog, GitHub Release creation).Fix
Three resilience mechanisms added to the "Determine version bump" step:
Title (#N), using the last match to avoid picking up issue references) and looks up the PR directly by numbergh apierrors are now captured and logged as::warning::annotations (retryable calls) or::error::with immediate job failure (direct PR lookup), instead of being silently swallowed via2>/dev/null || echo ""Type of Change
Next steps
Merging this PR serves as the initial release trigger — the fixed pipeline will bump
1.0.0→1.0.1and create the first GitHub Release. Edit the checkbox above to Minor before merge ifv1.1.0is preferred.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.