Skip to content

Commit

Permalink
enable differentiated error messages for DR eligibility when API retu…
Browse files Browse the repository at this point in the history
…rns 403
  • Loading branch information
elireisman authored May 11, 2022
1 parent 2fee08e commit cabd238
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ async function run(): Promise<void> {
}
} catch (error) {
if (error instanceof RequestError && error.status === 404) {
core.setFailed(
`Dependency review could not obtain dependency data for the specified owner, repository, or revision range.`
)
} else if (error instanceof RequestError && error.status === 403) {
core.setFailed(
`Dependency review is not supported on this repository. Please ensure that Dependency graph is enabled, see https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/settings/security_analysis`
)
Expand Down

0 comments on commit cabd238

Please sign in to comment.