From 96d460bdfd32d9768769702c674065c5902e9c19 Mon Sep 17 00:00:00 2001 From: Harry Marr Date: Mon, 15 Mar 2021 18:23:56 -0400 Subject: [PATCH] Add missing breaks --- dist/index.js | 2 ++ src/approve.ts | 2 ++ 2 files changed, 4 insertions(+) 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}`); }