feat: enhance error message (#398)

This commit is contained in:
Shohei Ueda 2020-07-15 02:04:43 +09:00 committed by GitHub
parent 6901b8e8fc
commit 3d656402e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@ Use deploy_key or personal_token.
if (eventName === 'push') { if (eventName === 'push') {
isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null; isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null;
if (isProhibitedBranch) { if (isProhibitedBranch) {
throw new Error(`You deploy from ${publishBranch} to ${publishBranch}`); throw new Error(`\
You deploy from ${publishBranch} to ${publishBranch}
This operation is prohibited to protect your contents
`);
} }
} }