Test failures fixed, added 3 new test cases

Signed-off-by: Jyotsna <Josh-01@github.com>
This commit is contained in:
Jyotsna 2020-11-05 13:53:15 +05:30
parent dd55519eee
commit e2bf0d0cc1
3 changed files with 83 additions and 17 deletions

19
dist/index.js generated vendored
View file

@ -12085,14 +12085,19 @@ function getInputs(defaultContext) {
githubToken: core.getInput('github-token'),
ssh: yield 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;
});
}