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

View File

@@ -85,7 +85,10 @@ Use deploy_key or personal_token.
if (eventName === 'push') {
isProhibitedBranch = ref.match(new RegExp(`^refs/heads/${publishBranch}$`)) !== null;
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
`);
}
}