Skip to content

Commit 11d9518

Browse files
authored
Merge pull request #61 from lucaomartins/master
2 parents 8ba27ad + 4932971 commit 11d9518

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
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.

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const core = require("@actions/core"),
33

44
const 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

0 commit comments

Comments
 (0)