From a49e03fe01b39c4e17cfcd49925e7a9633989cf7 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Tue, 2 Jan 2024 14:29:39 +0700 Subject: [PATCH] fix: regex --- README.md | 2 +- dist/index.js | 3 ++- index.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 488f006..54eaf3e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ verify-branch-name: name: Verify Branch Name runs-on: ubuntu-latest steps: - - uses: namnh240795/verify-branch-name-action@v1.1.0 + - uses: namnh240795/verify-branch-name-action@v1.1.1 with: regex: production ``` \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 6f60ac6..338b26b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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; } diff --git a/index.js b/index.js index 9563207..084d06d 100644 --- a/index.js +++ b/index.js @@ -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; }