Skip to content

Commit

Permalink
fix: regex
Browse files Browse the repository at this point in the history
  • Loading branch information
namnh240795 committed Jan 2, 2024
1 parent 30342d1 commit a49e03f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ verify-branch-name:
name: Verify Branch Name
runs-on: ubuntu-latest
steps:
- uses: namnh240795/[email protected].0
- uses: namnh240795/[email protected].1
with:
regex: production
```
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30805,7 +30805,8 @@ try {
core.setFailed(`Invalid branch name.\n`, "See convention.md for more details.\n");
return;
}
if (!regex.test(branchName)) {
const expression = new RegExp(regex);
if (!expression.test(branchName)) {
core.setFailed(`Invalid branch name.\n`, "See convention.md for more details.\n");
return;
}
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ try {
core.setFailed(`Invalid branch name.\n`, "See convention.md for more details.\n");
return;
}
if (!regex.test(branchName)) {
const expression = new RegExp(regex);
if (!expression.test(branchName)) {
core.setFailed(`Invalid branch name.\n`, "See convention.md for more details.\n");
return;
}
Expand Down

0 comments on commit a49e03f

Please sign in to comment.