Skip to content

Commit cdb13a2

Browse files
committed
Warn reviewers to verify preview URL before clicking
Adds a callout in the run summary and PR comment asking the developer to confirm the link matches the workflow run and points to trycloudflare.com before opening it.
1 parent 070ca4a commit cdb13a2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/preview-docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,13 @@ jobs:
140140
echo "| Lifetime | $DURATION_MINUTES min |"
141141
echo ""
142142
echo "The link goes dead when this job ends."
143+
echo ""
144+
echo "> :warning: Please double-check the URL before clicking. The preview runs on a one-time public tunnel — confirm the link in this summary matches the one in any PR comment, and make sure it points to \`trycloudflare.com\`."
143145
} >> "$GITHUB_STEP_SUMMARY"
144146
145147
if [ -n "$PR_NUMBER" ]; then
146-
BODY=$(printf '**Docs preview:** %s\n\nProduct: `%s` · Ref: `%s` · Live for %s min.\n\n_Triggered by @%s via the Preview Docs workflow._' \
147-
"$URL" "$PRODUCT" "$RESOLVED_REF" "$DURATION_MINUTES" "$GITHUB_ACTOR")
148+
BODY=$(printf '**Docs preview:** %s\n\nProduct: `%s` · Ref: `%s` · Live for %s min.\n\n> :warning: Please double-check the URL before clicking. Confirm it matches the link in the [workflow run summary](%s/actions/runs/%s) and that it points to `trycloudflare.com`.\n\n_Triggered by @%s via the Preview Docs workflow._' \
149+
"$URL" "$PRODUCT" "$RESOLVED_REF" "$DURATION_MINUTES" "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" "$GITHUB_ACTOR")
148150
gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY" || \
149151
echo "::warning::Failed to post PR comment (continuing anyway)."
150152
fi

0 commit comments

Comments
 (0)