mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-28 23:36:41 +02:00
enforce secrets input value as registered secret
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
84ad562665
commit
9a6e79724f
3 changed files with 32 additions and 17 deletions
|
@ -69,7 +69,7 @@ export async function getInputs(): Promise<Inputs> {
|
|||
pull: core.getBooleanInput('pull'),
|
||||
push: core.getBooleanInput('push'),
|
||||
sbom: core.getInput('sbom'),
|
||||
secrets: Util.getInputList('secrets', {ignoreComma: true}),
|
||||
secrets: getSecretsInput(),
|
||||
'secret-envs': Util.getInputList('secret-envs'),
|
||||
'secret-files': Util.getInputList('secret-files', {ignoreComma: true}),
|
||||
'shm-size': core.getInput('shm-size'),
|
||||
|
@ -296,3 +296,18 @@ async function getAttestArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<st
|
|||
|
||||
return args;
|
||||
}
|
||||
|
||||
function getSecretsInput(): string[] {
|
||||
const secrets = Util.getInputList('secrets', {ignoreComma: true});
|
||||
|
||||
for (const secret of secrets) {
|
||||
try {
|
||||
// enforce value as registered GitHub Secret
|
||||
Build.parseSecretKvp(secret, true);
|
||||
} catch (err) {
|
||||
// ignore invalid secret
|
||||
}
|
||||
}
|
||||
|
||||
return secrets;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue