From 6d74047dcef155976a15e4a124dde2c7fe0c5522 Mon Sep 17 00:00:00 2001 From: kiblik Date: Fri, 10 May 2024 13:27:04 +0200 Subject: [PATCH] fix: Handle error when label is not available (#123) --- dist/index.js | 2 +- sources/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index ea73274..8821d37 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29880,7 +29880,7 @@ function removeLabelIfExists(labelName_1, issue_1, _a) { .then(() => true, (error) => { if ((error.status === 403 || error.status === 404) && continueOnMissingPermissions() && - error.message.endsWith(`Resource not accessible by integration`)) { + error.message.includes(`Resource not accessible by integration`)) { core.warning(`could not remove label "${labelName}": ${commonErrorDetailedMessage}`); } else if (error.status !== 404) { diff --git a/sources/main.ts b/sources/main.ts index 16c4fad..e636819 100644 --- a/sources/main.ts +++ b/sources/main.ts @@ -307,7 +307,7 @@ async function removeLabelIfExists( if ( (error.status === 403 || error.status === 404) && continueOnMissingPermissions() && - error.message.endsWith(`Resource not accessible by integration`) + error.message.includes(`Resource not accessible by integration`) ) { core.warning( `could not remove label "${labelName}": ${commonErrorDetailedMessage}`,