Skip to content

Commit 9fd6d6d

Browse files
authored
fix: Handle error when label is not available (part 2) (#126)
1 parent 6d74047 commit 9fd6d6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29851,7 +29851,7 @@ function addLabelIfNotExists(labelName_1, issue_1, _a) {
2985129851
.then(() => true, (error) => {
2985229852
if ((error.status === 403 || error.status === 404) &&
2985329853
continueOnMissingPermissions() &&
29854-
error.message.endsWith(`Resource not accessible by integration`)) {
29854+
error.message.includes(`Resource not accessible by integration`)) {
2985529855
core.warning(`could not add label "${labelName}": ${commonErrorDetailedMessage}`);
2985629856
}
2985729857
else {
@@ -29906,7 +29906,7 @@ function addComment(comment_1, _a, _b) {
2990629906
catch (error) {
2990729907
if ((error.status === 403 || error.status === 404) &&
2990829908
continueOnMissingPermissions() &&
29909-
error.message.endsWith(`Resource not accessible by integration`)) {
29909+
error.message.includes(`Resource not accessible by integration`)) {
2991029910
core.warning(`couldn't add comment "${comment}": ${commonErrorDetailedMessage}`);
2991129911
}
2991229912
else {

sources/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async function addLabelIfNotExists(
265265
if (
266266
(error.status === 403 || error.status === 404) &&
267267
continueOnMissingPermissions() &&
268-
error.message.endsWith(`Resource not accessible by integration`)
268+
error.message.includes(`Resource not accessible by integration`)
269269
) {
270270
core.warning(
271271
`could not add label "${labelName}": ${commonErrorDetailedMessage}`,
@@ -340,7 +340,7 @@ async function addComment(
340340
if (
341341
(error.status === 403 || error.status === 404) &&
342342
continueOnMissingPermissions() &&
343-
error.message.endsWith(`Resource not accessible by integration`)
343+
error.message.includes(`Resource not accessible by integration`)
344344
) {
345345
core.warning(
346346
`couldn't add comment "${comment}": ${commonErrorDetailedMessage}`,

0 commit comments

Comments
 (0)