mirror of
https://code.forgejo.org/actions/checkout.git
synced 2026-06-29 16:18:56 +00:00
Merge e1d91899ae into f9e715a95f
This commit is contained in:
commit
709f695694
3 changed files with 34 additions and 2 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
|
@ -224,6 +224,10 @@ class GitAuthHelper {
|
|||
// Override HOME
|
||||
core.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;
|
||||
});
|
||||
}
|
||||
|
|
@ -307,8 +311,9 @@ class GitAuthHelper {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var _a;
|
||||
if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.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');
|
||||
yield io.rmRF(this.temporaryHomePath);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue