Fixed link to dockerfile

Signed-off-by: Jyotsna <Josh-01@github.com>
This commit is contained in:
Jyotsna 2020-11-11 21:07:49 +05:30
parent 065688b98f
commit c59c0cec43
3 changed files with 50 additions and 15 deletions

9
dist/index.js generated vendored
View file

@ -12092,7 +12092,14 @@ function getInputs(defaultContext) {
userInputs.outputs.find(val => val.indexOf('type=image') > -1 || val.indexOf('type=registry') > -1))) {
//Add link to dockerfile as label
let dockerfilePath = userInputs.file;
let repoPath = defaultContext.replace('#head', '/blob');
let stringToReplace = '';
if (defaultContext.indexOf('#heads')) {
stringToReplace = '.git#heads';
}
else if (defaultContext.indexOf('#tags')) {
stringToReplace = '.git#tags';
}
let repoPath = defaultContext.replace(stringToReplace, '/blob');
userInputs.labels.push(`dockerfile-path=${repoPath}/${dockerfilePath}`);
}
return userInputs;