File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11name : Comment on Fork PRs
22
33on :
4- pull_request :
4+ pull_request_target :
55 types : [opened, reopened, synchronize]
66
7+ # Required permissions for commenting on PRs
8+ permissions :
9+ contents : read
10+ pull-requests : write
11+
712jobs :
813 comment-on-fork-pr :
914 runs-on : ubuntu-latest
1621 script : |-
1722 const prNumber = context.payload.pull_request.number;
1823 const workflowUrl = `https://github.com/ruby/rdoc/actions/workflows/cloudflare-preview.yml`;
19- const branch = context.payload.pull_request.head.ref;
2024 const commentMarker = "## Cloudflare Preview Deployment";
2125
2226 // Create a direct link that pre-fills the PR number input
3842 const messageLines = [
3943 `${commentMarker}`,
4044 `⚠️ This PR is from a fork, so the preview deployment workflow doesn't run automatically for security reasons.`,
41- `If you're a maintainer and want to preview this PR:`,
4245 ``,
43- `[➡️ Click here to run the workflow with PR #${prNumber} pre-filled](${dispatchUrl})`,
46+ `### For Maintainers:`,
47+ `[🚀 Click here to run the preview deployment workflow](${dispatchUrl})`,
4448 ``,
4549 `This will trigger a Cloudflare Pages preview deployment for this PR.`
4650 ];
You can’t perform that action at this time.
0 commit comments