Skip to content

Commit 9dfd79d

Browse files
committed
Error message when unauthorized is 'Resource not accessible by integration'
1 parent 5f28ec9 commit 9dfd79d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
314314
})
315315
return checkRunId
316316
} catch (err) {
317-
if (err.message === 'Not Found') {
317+
if (err.message === 'Resource not accessible by integration') {
318318
throw new GitHubApiUnauthorizedError(`Unable to create a check, please make sure that the provided 'repo-token' has write permissions to ${owner}/${repo} - cause: ${err}`)
319319
}
320320
throw new GitHubApiError(`Unable to create a check to ${owner}/${repo} - cause: ${err}`)

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
4141
})
4242
return checkRunId
4343
} catch (err) {
44-
if (err.message === 'Not Found') {
44+
if (err.message === 'Resource not accessible by integration') {
4545
throw new GitHubApiUnauthorizedError(`Unable to create a check, please make sure that the provided 'repo-token' has write permissions to ${owner}/${repo} - cause: ${err}`)
4646
}
4747
throw new GitHubApiError(`Unable to create a check to ${owner}/${repo} - cause: ${err}`)

0 commit comments

Comments
 (0)