diff --git a/dist/index.js b/dist/index.js index 371567b..40a45b6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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}`); } diff --git a/src/approve.ts b/src/approve.ts index b86ac03..aed299c 100644 --- a/src/approve.ts +++ b/src/approve.ts @@ -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}`); }