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/dist
diff options
context:
space:
mode:
authorAiqiao Yan <55104035+aiqiaoy@users.noreply.github.com>2026-07-15 10:02:03 -0400
committerGitHub <noreply@github.com>2026-07-15 10:02:03 -0400
commit76455ef5af5e6c1ef9b1743192c21303bad9dbfc (patch)
treee1729018b0ec4f569a16d0d56476b391705cde04 /dist
parentc0efd32b49627d541b30e32136690425ed8a86d4 (diff)
skip running unsafe pr check if input is default (#2518)
Diffstat (limited to 'dist')
-rw-r--r--dist/index.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/dist/index.js b/dist/index.js
index b381bd2..cc25215 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -42191,12 +42191,19 @@ async function getInputs() {
(getInput('allow-unsafe-pr-checkout') || 'false').toUpperCase() ===
'TRUE';
core_debug(`allow unsafe PR checkout = ${result.allowUnsafePrCheckout}`);
- 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 && !getInput('ref');
+ if (!isDefaultCheckout) {
+ assertSafePrCheckout({
+ qualifiedRepository,
+ ref: result.ref,
+ commit: result.commit,
+ allowUnsafePrCheckout: result.allowUnsafePrCheckout
+ });
+ }
return result;
}