Skip to content

Commit

Permalink
Add missing breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hmarr committed Mar 15, 2021
1 parent 72579aa commit 96d460b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5891,10 +5891,12 @@ function approve(token, context) {
case 401:
core.setFailed(`${error.message}. Please check that the \`github-token\` input ` +
`parameter is set correctly.`);
break;
case 403:
core.setFailed(`${error.message}. In some cases, the GitHub token used for actions triggered ` +
`from \`pull_request\` events are read-only, which can cause this problem. ` +
`Switching to the \`pull_request_target\` event typically resolves this issue.`);
break;
default:
core.setFailed(`Error (code ${error.status}): ${error.message}`);
}
Expand Down
2 changes: 2 additions & 0 deletions src/approve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export async function approve(token: string, context: Context) {
`${error.message}. Please check that the \`github-token\` input ` +
`parameter is set correctly.`
);
break;
case 403:
core.setFailed(
`${error.message}. In some cases, the GitHub token used for actions triggered ` +
`from \`pull_request\` events are read-only, which can cause this problem. ` +
`Switching to the \`pull_request_target\` event typically resolves this issue.`
);
break;
default:
core.setFailed(`Error (code ${error.status}): ${error.message}`);
}
Expand Down

0 comments on commit 96d460b

Please sign in to comment.