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 1
1
name : Comment on Fork PRs
2
2
3
3
on :
4
- pull_request :
4
+ pull_request_target :
5
5
types : [opened, reopened, synchronize]
6
6
7
+ # Required permissions for commenting on PRs
8
+ permissions :
9
+ contents : read
10
+ pull-requests : write
11
+
7
12
jobs :
8
13
comment-on-fork-pr :
9
14
runs-on : ubuntu-latest
16
21
script : |-
17
22
const prNumber = context.payload.pull_request.number;
18
23
const workflowUrl = `https://github.com/ruby/rdoc/actions/workflows/cloudflare-preview.yml`;
19
- const branch = context.payload.pull_request.head.ref;
20
24
const commentMarker = "## Cloudflare Preview Deployment";
21
25
22
26
// Create a direct link that pre-fills the PR number input
38
42
const messageLines = [
39
43
`${commentMarker}`,
40
44
`⚠️ 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:`,
42
45
``,
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})`,
44
48
``,
45
49
`This will trigger a Cloudflare Pages preview deployment for this PR.`
46
50
];
You can’t perform that action at this time.
0 commit comments