From 01e894d3c02a031831f3cba9132a19dfe19fec0e Mon Sep 17 00:00:00 2001 From: Jonathan Grimes Date: Fri, 28 Feb 2020 10:53:55 -0600 Subject: [PATCH] update the correct config --- dist/index.js | 4 +++- src/git-source-provider.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 (