diff --git a/dist/index.js b/dist/index.js index fd631eb..3bbe206 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5631,7 +5631,9 @@ function configureAuthToken(git, authToken, global) { const basicCredential = Buffer.from(`x-access-token:${authToken}`, 'utf8').toString('base64'); core.setSecret(basicCredential); // Replace the value in the config file - const configPath = path.join(git.getWorkingDirectory(), '.git', 'config'); + const configPath = global + ? path.join(process.env.HOME, '.gitconfig') + : path.join(git.getWorkingDirectory(), '.git', 'config'); let content = (yield fs.promises.readFile(configPath)).toString(); const placeholderIndex = content.indexOf(placeholder); if (placeholderIndex < 0 || diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts index bd11743..d64a99e 100644 --- a/src/git-source-provider.ts +++ b/src/git-source-provider.ts @@ -285,7 +285,9 @@ async function configureAuthToken( core.setSecret(basicCredential) // Replace the value in the config file - const configPath = path.join(git.getWorkingDirectory(), '.git', 'config') + const configPath = global + ? path.join(process.env.HOME as string, '.gitconfig') + : path.join(git.getWorkingDirectory(), '.git', 'config') let content = (await fs.promises.readFile(configPath)).toString() const placeholderIndex = content.indexOf(placeholder) if (