Pass through original GITHUB_TOKEN in scrub-env mode
This commit is contained in:
committed by
pullfrog[bot]
parent
75b429ceca
commit
4547b0032e
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user