fix: omit source_sha in retry mode - #764
Conversation
In retry mode the branch HEAD may have moved since the original run (e.g. from merging the fix PR), so passing the stale source_sha causes the workflow to reject it with 'Dispatched SHA differs from requested SHA'. Don't pass source_sha in retry mode, and drop the head_sha filter from the run correlation so it matches by request_id+actor+branch only.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2dff00673
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if [ -n "$RETRY_RUN_ID" ]; then | ||
| SOURCE_SHA_FIELD="" | ||
| else | ||
| SOURCE_SHA_FIELD="--field source_sha=$COMMIT_SHA" |
There was a problem hiding this comment.
Pin retries to the current branch SHA
When retrying after the branch has moved, the confirmation still displays the original run's .headSha, but omitting this field makes GitHub resolve --ref to whatever the branch HEAD is at dispatch time. An unrelated push before dispatch can therefore cause a real retry to publish code the operator was never shown or asked to confirm. Resolve the current remote HEAD for retry mode, display it, and pass that value as source_sha so the workflow retains its mismatch guard.
Useful? React with 👍 / 👎.
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
CI Test ResultsRun: #36587155523 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-09-29 16:03:05 UTC |
Fixes retry mode: the original run's source_sha is stale after merging fix PRs, causing the workflow to reject the dispatch. Don't pass source_sha in retry mode; drop the head_sha filter from run correlation.