File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 6767 with :
6868 github-token : ${{ secrets.GITHUB_TOKEN }} # The `GITHUB_TOKEN` secret.
6969 release : release # The `release` branch.
70+ release-regex : ^release/(.*) # The regex for `release` branch.
7071 dev : dev # The `dev` branch.
7172 master : master # The `master` branch.
7273 label : gitflow # The pull request label.
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ inputs:
1313 release :
1414 description : The `release` branch.
1515 default : release
16+ release-regex :
17+ description : The `release` branch regex.
18+ default : null
1619 dev :
1720 description : The `dev` branch.
1821 default : dev
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const core = require("@actions/core"),
33
44const token = core . getInput ( "github-token" , { required : true } ) ,
55 releaseBranch = getBranch ( "release" ) ,
6+ releaseBranchRegex = RegExp ( getInput ( "release-regex" , null ) ) ,
67 devBranch = getBranch ( "dev" ) ,
78 masterBranch = getBranch ( "master" ) ,
89 label = getInput ( "label" , "gitflow" ) ,
@@ -26,7 +27,11 @@ function getTarget(head) {
2627 switch ( head ) {
2728 case releaseBranch : return masterBranch ;
2829 case masterBranch : return devBranch ;
29- default : return null ;
30+ default :
31+ if ( releaseBranchRegex && releaseBranchRegex . test ( head ) ) {
32+ return masterBranch ;
33+ }
34+ return null ;
3035 }
3136}
3237
You can’t perform that action at this time.
0 commit comments