This commit is contained in:
Nathan Moin Vaziri 2026-07-16 15:31:38 +09:00 committed by GitHub
commit 33605ef243
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 2 deletions

7
dist/index.js vendored
View file

@ -35109,6 +35109,10 @@ class GitAuthHelper {
// Override HOME
info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
// GIT_CONFIG_GLOBAL takes precedence over HOME when locating the global
// config file. Pin it to the temporary config so an inherited
// GIT_CONFIG_GLOBAL cannot redirect our global git config writes elsewhere.
this.git.setEnvironmentVariable('GIT_CONFIG_GLOBAL', newGitConfigPath);
return newGitConfigPath;
}
async configureGlobalAuth() {
@ -35183,8 +35187,9 @@ class GitAuthHelper {
}
async removeGlobalConfig() {
if (this.temporaryHomePath?.length > 0) {
core_debug(`Unsetting HOME override`);
core_debug(`Unsetting HOME and GIT_CONFIG_GLOBAL overrides`);
this.git.removeEnvironmentVariable('HOME');
this.git.removeEnvironmentVariable('GIT_CONFIG_GLOBAL');
await rmRF(this.temporaryHomePath);
}
}