(opts: {
eventName: string | undefined;
cwdProvided: boolean;
})
| 59 | * already-trusted directory) satisfies the check for those staying on it. |
| 60 | */ |
| 61 | export function pullRequestTargetCwdError(opts: { |
| 62 | eventName: string | undefined; |
| 63 | cwdProvided: boolean; |
| 64 | }): string | null { |
| 65 | if (opts.eventName !== 'pull_request_target' || opts.cwdProvided) return null; |
| 66 | return [ |
| 67 | '`bumpy ci check` is running under pull_request_target without --cwd.', |
| 68 | '', |
| 69 | 'This is the unsafe configuration. pull_request_target grants a write token and', |
| 70 | 'secrets even on fork PRs, and the current directory is the (untrusted) PR', |
| 71 | "checkout — so a fork PR's bunfig.toml/.npmrc can redirect where bumpy itself is", |
| 72 | 'fetched from, at the exact version you pinned.', |
| 73 | '', |
| 74 | 'Recommended fix: stop using pull_request_target. Run `ci check` on the plain', |
| 75 | '`pull_request` event and post fork-PR comments from a separate workflow_run job:', |
| 76 | ` ${DOCS_URL}#commenting-on-fork-prs`, |
| 77 | '', |
| 78 | 'To stay on pull_request_target, check the PR head into ./pr from a trusted base', |
| 79 | 'checkout and run `bumpy ci check --cwd ./pr` (or `--cwd .` if the current', |
| 80 | 'checkout is already trusted, e.g. a same-repo PR).', |
| 81 | ].join('\n'); |
| 82 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…