Skip to content

Commit f477955

Browse files
authored
Merge pull request #1451 from crazy-max/fix-git-auth-token
scope default git auth token to github.com
2 parents 8c1e8f8 + 9760b30 commit f477955

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

__tests__/context.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ ccc"`],
232232
[
233233
'build',
234234
'--output', '.',
235-
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
235+
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
236236
'https://github.com/docker/build-push-action.git#refs/heads/master'
237237
],
238238
undefined
@@ -478,7 +478,7 @@ nproc=3`],
478478
[
479479
'build',
480480
'--iidfile', imageIDFilePath,
481-
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
481+
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
482482
'--metadata-file', metadataJson,
483483
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
484484
],

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
183183
}
184184
});
185185
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
186-
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN=${inputs['github-token']}`));
186+
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN.github.com=${inputs['github-token']}`));
187187
}
188188
if (inputs['shm-size']) {
189189
args.push('--shm-size', inputs['shm-size']);

0 commit comments

Comments
 (0)