Skip to content

Wait for Pages deployment before posting preview link - #1873

Merged
pmckinney-codat merged 1 commit into
mainfrom
pr-preview-wait-for-pages
Aug 5, 2026
Merged

Wait for Pages deployment before posting preview link#1873
pmckinney-codat merged 1 commit into
mainfrom
pr-preview-wait-for-pages

Conversation

@pmckinney-codat

Copy link
Copy Markdown
Collaborator

What

Adds wait-for-pages-deployment: true to the rossjrw/pr-preview-action step, plus the pages: read permission the wait needs to poll the Pages builds API (the job's explicit permissions block 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-preview job runs ~30–60s longer while it waits.

🤖 Generated with Claude Code

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
pmckinney-codat merged commit 40ccdf4 into main Aug 5, 2026
4 of 6 checks passed
@pmckinney-codat
pmckinney-codat deleted the pr-preview-wait-for-pages branch August 5, 2026 13:58
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-05 13:58 UTC

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Link check results:

[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants