mirror of
https://github.com/docker/build-push-action.git
synced 2026-01-20 17:48:55 +08:00
Test failures fixed, added 3 new test cases
Signed-off-by: Jyotsna <Josh-01@github.com>
This commit is contained in:
parent
dd55519eee
commit
e2bf0d0cc1
3 changed files with 83 additions and 17 deletions
|
|
@ -76,17 +76,22 @@ export async function getInputs(defaultContext: string): Promise<Inputs> {
|
|||
ssh: await getInputList('ssh')
|
||||
};
|
||||
|
||||
//Add repo as source-label if not already supplied by user
|
||||
const sourceLabelKey = 'org.opencontainers.image.source';
|
||||
if (userInputs.labels.find(val => val.startsWith(sourceLabelKey) == true) == null) {
|
||||
userInputs.labels.push(
|
||||
`${sourceLabelKey}=https://github.com/${github.context.repo.owner}/${github.context.repo.repo}`
|
||||
);
|
||||
}
|
||||
if (
|
||||
userInputs.load == true ||
|
||||
userInputs.push == true ||
|
||||
userInputs.outputs.find(val => val.indexOf('type=image') > -1 || val.indexOf('type=registry') > -1)
|
||||
) {
|
||||
//Add repo as source-label if not already supplied by user
|
||||
const sourceLabelKey = 'org.opencontainers.image.source';
|
||||
if (userInputs.labels.find(val => val.startsWith(sourceLabelKey) == true) == null) {
|
||||
const githubOwnerRepoUrl = defaultContext.split('#')[0];
|
||||
userInputs.labels.push(`${sourceLabelKey}=${githubOwnerRepoUrl}`);
|
||||
}
|
||||
|
||||
//Add dockerfile path as label
|
||||
let dockerfilePath = userInputs.file;
|
||||
userInputs.labels.push(`dockerfile-path=${dockerfilePath}`);
|
||||
//Add dockerfile path as label
|
||||
let dockerfilePath = userInputs.file;
|
||||
userInputs.labels.push(`dockerfile-path=${dockerfilePath}`);
|
||||
}
|
||||
|
||||
return userInputs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue