Wait for Pages deployment before posting preview link - #1873
Merged
Conversation
pr-preview-action posts its sticky comment as soon as the build lands on gh-pages, ~30-60s before the GitHub Pages deployment finishes, so the preview link 404s at first. wait-for-pages-deployment holds the comment until the deployment is live; pages: read lets the wait poll the Pages builds API (the explicit permissions block zeroes it otherwise). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pmckinney-codat
enabled auto-merge
August 5, 2026 13:57
Rachel-Codat
approved these changes
Aug 5, 2026
|
|
Link check results: |
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.
What
Adds
wait-for-pages-deployment: trueto therossjrw/pr-preview-actionstep, plus thepages: readpermission the wait needs to poll the Pages builds API (the job's explicitpermissionsblock otherwise zeroes it).Why
The preview sticky comment currently lands as soon as the build is pushed to
gh-pages, ~30–60s before the GitHub Pages deployment actually finishes — so the link 404s if you click it straight away (e.g. #1850 (comment)). With this input the action tracks the Pages build and only posts the comment once the URL is live.Same change is going into the other two repos that share this preview pattern (codat-docs / engineering-blog / help).
Trade-off: the
deploy-previewjob runs ~30–60s longer while it waits.🤖 Generated with Claude Code