mirror of
https://github.com/docker/build-push-action.git
synced 2026-02-16 23:31:45 +00:00
scope default git auth token to github.com
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
8c1e8f8e5b
commit
d40bd56b13
2 changed files with 3 additions and 3 deletions
|
|
@ -232,7 +232,7 @@ ccc"`],
|
||||||
[
|
[
|
||||||
'build',
|
'build',
|
||||||
'--output', '.',
|
'--output', '.',
|
||||||
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
|
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
|
||||||
'https://github.com/docker/build-push-action.git#refs/heads/master'
|
'https://github.com/docker/build-push-action.git#refs/heads/master'
|
||||||
],
|
],
|
||||||
undefined
|
undefined
|
||||||
|
|
@ -478,7 +478,7 @@ nproc=3`],
|
||||||
[
|
[
|
||||||
'build',
|
'build',
|
||||||
'--iidfile', imageIDFilePath,
|
'--iidfile', imageIDFilePath,
|
||||||
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
|
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
|
||||||
'--metadata-file', metadataJson,
|
'--metadata-file', metadataJson,
|
||||||
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
|
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
|
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
|
||||||
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN=${inputs['github-token']}`));
|
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN.github.com=${inputs['github-token']}`));
|
||||||
}
|
}
|
||||||
if (inputs['shm-size']) {
|
if (inputs['shm-size']) {
|
||||||
args.push('--shm-size', inputs['shm-size']);
|
args.push('--shm-size', inputs['shm-size']);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue