Repository navigation
ci(docs): recheck the PR before each preview push attempt (follow-up to #213) - #214
timosachsenberg wants to merge 1 commit into
Conversation
A retry could otherwise overwrite the preview of a newer head of the same PR, or recreate the directory of a PR that was closed and cleaned up in the meantime. Each attempt now asks the API whether the PR is still open at the commit the docs were built from, and the preview comment is only written when this run published the preview. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149aXmb68jU8gXuhSYiRqYt
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
📖 Documentation Preview The documentation for this PR has been built and is available at: This preview will be updated automatically when you push new commits to this PR. Preview built from commit: |
Requested by Timo · project thread
What this changes
This is the CodeRabbit finding on #213 (thread), which was merged before the fix went in.
The retry loop in
deploy-previewcan run for a few minutes. In that time, the same PR might get a newer head whose preview is deployed first. The older build's retry would then overwrite that newer preview. Likewise, if the PR is closed and the cleanup job removespr-<N>/, a retry could recreate the directory.workflow_run.head_sha(gh api .../pulls/N). If it is closed or has a newer head, the step leavesgh_pagesalone and ends without error.published=trueonly when it pushed, or when the preview was already current. The comment step runs only then, so a skipped run doesn't post a link to a preview it didn't deploy.Testing
actionlint1.7.12 with shellcheck: no findings.gh, starting six deploys at once. Four of them were for open PRs and were all deployed. One was for a PR that had a newer head, and its existing preview was left untouched. One was for a closed PR, and no directory was created for it. The two skipped runs set nopublishedoutput.AI use
Design intent: keep the check inside the loop, right after
gh_pagesis refreshed, because only there do we know that this push would replace the current state. The check before the loop (from #213) stays, so a mismatched artifact is rejected before anything is downloaded.Generated by Claude Code