Skip to content

Commit e055ee3

Browse files
committed
ci(pages): avoid telemetry 404 annotations by verifying run and swallowing non-2xx with notices; no effect on deploy
1 parent 3176841 commit e055ee3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,19 @@ jobs:
6161
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6363
run: |
64+
set +e
6465
gh --version
65-
gh api -X POST "repos/$GITHUB_REPOSITORY/pages/telemetry"
66-
continue-on-error: true
66+
# Only attempt telemetry when the run exists and the endpoint is available.
67+
if gh api -X GET "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >/dev/null 2>&1; then
68+
gh api -X POST \
69+
-H "Accept: application/vnd.github+json" \
70+
-H "X-GitHub-Api-Version: 2022-11-28" \
71+
"repos/$GITHUB_REPOSITORY/pages/telemetry" \
72+
&& echo "Telemetry reported" \
73+
|| echo "::notice::Pages telemetry endpoint returned non-2xx; skipping (harmless)."
74+
else
75+
echo "::notice::Workflow run $GITHUB_RUN_ID not found for telemetry; skipping."
76+
fi
6777
6878
deploy:
6979
name: Deploy to Pages

0 commit comments

Comments
 (0)