mirror of
https://github.com/actions/checkout.git
synced 2026-07-18 20:20:08 +08:00
Merge 2d76d21b2e into 12cd2235ef
This commit is contained in:
commit
33605ef243
3 changed files with 34 additions and 2 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue