fix: isProhibitedBranch detection (#394)

Co-authored-by: peaceiris <30958501+peaceiris@users.noreply.github.com>
This commit is contained in:
Zachandpeaceiris authored and GitHub committed 2020-07-14 09:05:55 +09:00
1 parent 6b76e36ab3
commit f53ab0c2a5
2 files changed
+27 -1

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ Use deploy_key or personal_token.
}
if (eventName === 'push') {
isProhibitedBranch = ref.includes(`refs/heads/${publishBranch}`);
isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null;
if (isProhibitedBranch) {
throw new Error(`You deploy from ${publishBranch} to ${publishBranch}`);
}