publish-prereleases: Exit if CircleCI request fails (#26100)

If the publish-prereleases command fails to access CircleCI, it will now
exit with a message instead of hanging indefinitely.
This commit is contained in:
Andrew Clark 2023-02-02 19:20:34 -05:00 committed by GitHub
parent 2ef24145e4
commit 855b77c9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -99,6 +99,15 @@ async function main() {
}
);
if (!pipelineResponse.ok) {
console.error(
theme.error(
`Failed to access CircleCI. Responded with status: ${pipelineResponse.status}`
)
);
process.exit(1);
}
const pipelineJSON = await pipelineResponse.json();
const pipelineID = pipelineJSON.id;