Skip to content

Commit

Permalink
Error message when unauthorized is 'Resource not accessible by integr…
Browse files Browse the repository at this point in the history
…ation'
  • Loading branch information
ggrossetie committed Oct 23, 2020
1 parent 5f28ec9 commit 9dfd79d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
})
return checkRunId
} catch (err) {
if (err.message === 'Not Found') {
if (err.message === 'Resource not accessible by integration') {
throw new GitHubApiUnauthorizedError(`Unable to create a check, please make sure that the provided 'repo-token' has write permissions to ${owner}/${repo} - cause: ${err}`)
}
throw new GitHubApiError(`Unable to create a check to ${owner}/${repo} - cause: ${err}`)
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
})
return checkRunId
} catch (err) {
if (err.message === 'Not Found') {
if (err.message === 'Resource not accessible by integration') {
throw new GitHubApiUnauthorizedError(`Unable to create a check, please make sure that the provided 'repo-token' has write permissions to ${owner}/${repo} - cause: ${err}`)
}
throw new GitHubApiError(`Unable to create a check to ${owner}/${repo} - cause: ${err}`)
Expand Down

0 comments on commit 9dfd79d

Please sign in to comment.