ci: post Cloudflare Pages preview URL as PR comment#15
Merged
Conversation
PR #4 added the deploy step but the wrangler-action does not auto-post a PR comment, so reviewers can't see the preview URL without digging into workflow logs (verified on PRs #12-14: deploy succeeded, comment missing). This adds a sticky comment step that uses the deployment-url output from the wrangler-action and posts (or updates) a single comment per PR via marocchino/sticky-pull-request-comment@v2. Also bumps the workflow's permissions to include pull-requests: write, which is required for the comment step.
|
🚀 Preview deployed to Cloudflare Pages
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloudflare/wrangler-action@v3does not auto-post a PR comment with the preview URL.https://hank-pilot-26-og-images.pilotprotocol.pages.devfor Add PILOT-26 OpenGraph images from Jira #14), but the PR comments array stayed empty.marocchino/sticky-pull-request-comment@v2step that consumes thedeployment-urloutput from the wrangler-action and posts (or updates) a single sticky comment per PR.Changes
permissions:block gainspull-requests: writeso the new step can comment.id: deployso the next step can reference its output.Comment preview URL on PRstep, gated onpull_request+ a non-emptydeployment-url(so it skips on push-to-main and on fork PRs where the deploy was skipped).Test plan
🚀 Preview deployed to Cloudflare Pages…with the commit-keyed deploy URL and the branch alias.cloudflare-pages-preview).Evidence the preview is already being generated
Deploy step log from PR #14's run 26650201315:
```
✨ Deployment complete! https://2b5c12ec.pilotprotocol.pages.dev
✨ Deployment alias URL: https://hank-pilot-26-og-images.pilotprotocol.pages.dev
```