enable differentiated error messages for DR eligibility when API returns 403

This commit is contained in:
Eli Reisman
2022-05-11 19:53:29 +00:00
committed by GitHub
parent 2fee08ee9a
commit cabd238caa

View File

@@ -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`
)