Merge pull request #60 from actions/elireisman/handle-403

Enable differentiated error messages for DR eligibility
This commit is contained in:
Eli Reisman
2022-05-12 11:13:53 -07:00
committed by GitHub
3 changed files with 8 additions and 1 deletions

3
dist/index.js generated vendored
View File

@@ -142,6 +142,9 @@ function run() {
}
catch (error) {
if (error instanceof request_error_1.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 request_error_1.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`);
}
else if (error instanceof Error) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

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