This repository was archived by the owner on Aug 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ Build and publish your repository as a Docker image and push it to GitHub Packag
2828
2929* Optional* . The desired tag for the image. Defaults to current branch or release version number.
3030
31+ ### ` imageTagPrefix `
32+
33+ * Optional* . Added to the beginning of the tag.
34+
35+ ### ` imageTagSuffix `
36+
37+ * Optional* . Added to the end of the tag.
38+
3139### ` buildArguments `
3240
3341* Optional* . Any additional build arguments to use when building the image.
Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ inputs:
2020 imageTag :
2121 description : " The desired tag for the image. Defaults to current branch or release version number."
2222 required : false
23+ imageTagPrefix :
24+ description : " Added to the beginning of the tag."
25+ required : false
26+ imageTagSuffix :
27+ description : " Added to the end of the tag."
28+ required : false
2329 buildArguments :
2430 description : " The build arguments for image."
2531 required : false
Original file line number Diff line number Diff 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+ /******/ } ) ;
You can’t perform that action at this time.
0 commit comments