ci: explicitly exit Node lint scripts to fix CI hang (#22794)

The three Node scripts that run under `setup-node` (lint-lockfile,
lint-runtime, setup-corepack) finish their main work but the Node
process does not exit — the event loop is kept alive by an outstanding
handle from one of the upstream libraries. In CI this causes the step
to hang indefinitely until the runner timeout fires.

Add an explicit `process.exit(0)` after the success path in each
script. setup-corepack is restructured so `main()` returns the
`$`corepack …`` promise and the success log moves into `.then()`
before the exit, keeping ordering deterministic.

Co-authored-by: Agent (authentik-m-split-pr-committed-every-mikado) <279763771+playpen-agent@users.noreply.github.com>
This commit is contained in:
Teffen Ellis
2026-06-02 18:42:14 +02:00
committed by GitHub
parent 12d4c0ac2d
commit 0d1abb6d75
3 changed files with 10 additions and 4 deletions
+2
View File
@@ -274,5 +274,7 @@ run()
} else {
logger.info("✅ Lockfile is in sync.");
}
process.exit(0);
})
.catch((error) => reportAndExit(error, logger));
+1
View File
@@ -110,5 +110,6 @@ async function main() {
main()
.then(() => {
logger.info("✅ Node.js and npm versions are in sync.");
process.exit(0);
})
.catch((error) => reportAndExit(error, logger));
+7 -4
View File
@@ -102,9 +102,12 @@ async function main() {
subcommand = "use";
}
await $`corepack ${subcommand} ${packageManager}`({ cwd });
logger.info("Corepack installed npm successfully");
return $`corepack ${subcommand} ${packageManager}`({ cwd });
}
main().catch((error) => reportAndExit(error, logger));
main()
.then(() => {
logger.info("Corepack setup completed successfully");
process.exit(0);
})
.catch((error) => reportAndExit(error, logger));