Pass through original GITHUB_TOKEN in scrub-env mode

This commit is contained in:
Colin McDonnell
2026-01-15 01:20:16 +00:00
committed by pullfrog[bot]
parent 75b429ceca
commit 4547b0032e
5 changed files with 28 additions and 8 deletions
+5
View File
@@ -26,6 +26,11 @@ function filterEnv(isPublicRepo: boolean): Record<string, string> {
if (isPublicRepo && isSensitive(key)) continue;
filtered[key] = value;
}
// restore original GITHUB_TOKEN (the one set by GitHub Actions, not our installation token)
// this allows git operations in subprocesses to work while keeping our installation token secure
if (process.env.ORIGINAL_GITHUB_TOKEN) {
filtered.GITHUB_TOKEN = process.env.ORIGINAL_GITHUB_TOKEN;
}
return filtered;
}