ci: fix production required-check race#1727
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7570ff7af5
ℹ️ 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".
| } else if (deploySha !== refreshedMainSha) { | ||
| core.setOutput('auto_deploy_allowed', 'false'); | ||
| core.notice( | ||
| `Skipping automatic production deploy because ${deploySha} was superseded by main ${refreshedMainSha}.`, | ||
| ); |
There was a problem hiding this comment.
Move stale-run skip before the hard failure
When a staging run for commit A finishes after main has already advanced to commit B, the guard never reaches this new neutral-skip branch: the earlier deploySha !== latestMainSha check near the start of the script still calls core.setFailed and returns. Because this branch only covers main changing after the required-check polling begins, the common superseded workflow_run case remains a failed production workflow instead of the intended skipped deploy.
Useful? React with 👍 / 👎.
What changed
Why
Staging can complete before required CI checks start or finish. The previous one-shot lookup falsely failed production automation even when the exact SHA checks later succeeded.
Validation
pnpm lint . --max-warnings=0pnpm typecheckpnpm test:contract: 4 shards / 4,127 tests passedNEXT_PUBLIC_SITE_URL=https://fermatmind.com NEXT_PUBLIC_API_URL=https://api.fermatmind.com pnpm buildgit diff --checkDeferred