Merge pull request #60 from actions/elireisman/handle-403
Enable differentiated error messages for DR eligibility
This commit is contained in:
+3
@@ -142,6 +142,9 @@ function run() {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
if (error instanceof request_error_1.RequestError && error.status === 404) {
|
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`);
|
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) {
|
else if (error instanceof Error) {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -53,6 +53,10 @@ async function run(): Promise<void> {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof RequestError && error.status === 404) {
|
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(
|
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`
|
`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`
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user