Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 1e471aa

Browse files
authored
useful tag name for MRs, added imageTagPrefix and imageTagSuffix
1 parent 429a7f3 commit 1e471aa

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

dist/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,18 @@ async function run() {
693693
let imageTag = core.getInput('imageTag', { required: false });
694694
const ref = process.env['GITHUB_REF'];
695695
const refArray = ref.split('/');
696-
if (!imageTag) imageTag = refArray[refArray.length - 1];
696+
if (!imageTag) {
697+
const refLast = refArray[refArray.length - 1];
698+
if (refLast === "merge" && refArray.length >= 2) {
699+
imageTag = "mr" + refArray[refArray.length - 2];
700+
} else {
701+
imageTag = refLast;
702+
}
703+
}
704+
let imageTagPrefix = core.getInput('imageTagPrefix', { required: false });
705+
if (imageTagPrefix) imageName = imageTagPrefix + imageName;
706+
let imageTagSuffix = core.getInput('imageTagSuffix', { required: false });
707+
if (imageTagSuffix) imageName = imageName + imageTagSuffix;
697708

698709
// Set some variables.
699710
const imageURL = `docker.pkg.github.com/${repository}/${imageName}:${imageTag}`
@@ -1073,4 +1084,4 @@ exports.exec = exec;
10731084

10741085
/***/ })
10751086

1076-
/******/ });
1087+
/******/ });

0 commit comments

Comments
 (0)