Skip to content

Commit 7663e43

Browse files
Wait for Pages deployment before posting preview link
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>
1 parent c22c093 commit 7663e43

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ jobs:
135135
permissions:
136136
contents: write
137137
pull-requests: write
138+
# wait-for-pages-deployment polls the Pages builds API
139+
pages: read
138140
steps:
139141
- uses: actions/checkout@v7
140142
with:
@@ -177,3 +179,6 @@ jobs:
177179
uses: rossjrw/pr-preview-action@v1
178180
with:
179181
source-dir: ./build
182+
# Hold the sticky comment until the Pages deployment is live;
183+
# otherwise the preview link 404s for the first minute or so
184+
wait-for-pages-deployment: true

0 commit comments

Comments
 (0)