fix: isProhibitedBranch detection (#394)

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

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}`);
}