feat: enhance error message (#398)
This commit is contained in:
parent
6901b8e8fc
commit
3d656402e5
|
@ -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
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue