MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / pullRequestTargetCwdError

Function pullRequestTargetCwdError

packages/bumpy/src/utils/cwd.ts:61–82  ·  view source on GitHub ↗
(opts: {
  eventName: string | undefined;
  cwdProvided: boolean;
})

Source from the content-addressed store, hash-verified

59 * already-trusted directory) satisfies the check for those staying on it.
60 */
61export 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}

Callers 2

cwd.test.tsFile · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…