Skip to content

Commit 0f2bb16

Browse files
committed
Fix doc preview wait step
1 parent 6e111a2 commit 0f2bb16

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,24 @@ jobs:
272272
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
273273
env:
274274
PREVIEW_URL: https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
275+
EXPECTED_SHA: ${{ github.sha }}
275276
run: |
277+
preview_ready=0
276278
marker_url="${PREVIEW_URL}/.preview-commit"
277279
for attempt in {1..60}; do
278280
marker=$(curl -fsSL "${marker_url}" || true)
279-
if [[ "${marker}" == "${{ github.sha }}" ]]; then
280-
echo "Doc preview is available at ${PREVIEW_URL}"
281-
exit 0
281+
if [[ "${marker}" == "${EXPECTED_SHA}" ]]; then
282+
preview_ready=1
283+
break
282284
fi
283285
echo "Waiting for doc preview marker ${marker_url} (${attempt}/60)"
284286
sleep 10
285287
done
286-
echo "error: doc preview marker did not update to ${{ github.sha }}" >&2
287-
exit 1
288+
if [[ "${preview_ready}" != "1" ]]; then
289+
echo "error: doc preview marker did not update to ${EXPECTED_SHA}" >&2
290+
exit 1
291+
fi
292+
echo "Doc preview is available at ${PREVIEW_URL}"
288293
289294
- name: Restore lychee cache
290295
id: restore-lychee-cache

0 commit comments

Comments
 (0)