Skip to content

Commit 4c1e449

Browse files
author
Connor Byrne
committed
fix(cicd): harden the guard against upstream and branch failures
Validate PyPI's payload instead of asserting its shape, so a changed or error response gives a clear diagnostic rather than an opaque TypeError. A missing or renamed branch no longer aborts the run before the other consumed line is evaluated, and main()'s failures set the exit code explicitly rather than relying on unhandled-rejection behaviour.
1 parent 7b1ad9b commit 4c1e449

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/cicd/check-stranded-release-commits.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* commits by design (dead lines, unreleased work) and would be pure noise.
1414
*/
1515
import { execFileSync } from 'child_process'
16+
import { pathToFileURL } from 'url'
1617

1718
export interface Commit {
1819
sha: string
@@ -253,7 +254,10 @@ async function main(): Promise<void> {
253254

254255
if (
255256
process.argv[1] &&
256-
import.meta.url.endsWith(process.argv[1].split('/').pop()!)
257+
import.meta.url === pathToFileURL(process.argv[1]).href
257258
) {
258-
void main()
259+
main().catch((error: unknown) => {
260+
console.error(error)
261+
process.exitCode = 1
262+
})
259263
}

0 commit comments

Comments
 (0)