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

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;