Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2026-07-15 14:55:26 +0000
committerGitHub <noreply@github.com>2026-07-15 14:55:26 +0000
commit6148a5c2f95dae45072916f6f2898bc299d91958 (patch)
tree97c2267c12236168f513d170ad3abd664c36bd3a /src
parentdc961c09ed360318cdce3e86b74c9ff0f37ed869 (diff)
skip running unsafe pr check if input is default (backport #2518 to releases/v4)copilot/backport-2518-releases-v4
Diffstat (limited to 'src')
-rw-r--r--src/input-helper.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/input-helper.ts b/src/input-helper.ts
index 2535148..3d98ed8 100644
--- a/src/input-helper.ts
+++ b/src/input-helper.ts
@@ -168,12 +168,19 @@ export async function getInputs(): Promise<IGitSourceSettings> {
'TRUE'
core.debug(`allow unsafe PR checkout = ${result.allowUnsafePrCheckout}`)
- unsafePrCheckoutHelper.assertSafePrCheckout({
- qualifiedRepository,
- ref: result.ref,
- commit: result.commit,
- allowUnsafePrCheckout: result.allowUnsafePrCheckout
- })
+ // The default self-checkout (this repository with no explicit ref) always
+ // resolves to the trusted ref/commit GitHub set for the triggering event, so
+ // the fork-checkout guard only needs to run when the caller customized the
+ // repository or ref.
+ const isDefaultCheckout = isWorkflowRepository && !core.getInput('ref')
+ if (!isDefaultCheckout) {
+ unsafePrCheckoutHelper.assertSafePrCheckout({
+ qualifiedRepository,
+ ref: result.ref,
+ commit: result.commit,
+ allowUnsafePrCheckout: result.allowUnsafePrCheckout
+ })
+ }
return result
}