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

View file

@ -85,7 +85,14 @@ export async function getInputs(defaultContext: string): Promise<Inputs> {
) {
//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}`);
}