ci: make the github action fail when a firebase command fails (#64801)

When a firebase command line execution fails, the github action should be shown as failing instead of continuing to attempt to run and resulting in
an exit code of 0 and success

PR Close #64801
This commit is contained in:
Joey Perrott 2025-10-30 14:43:41 +00:00 committed by Andrew Scott
parent 90452f53df
commit 7a4813104c
3 changed files with 11 additions and 3 deletions

View file

@ -103,7 +103,7 @@ export async function setupRedirect(deployment: Deployment) {
}
function firebase(cmd: string, cwd?: string) {
spawnSync('npx', `-y firebase-tools@13.15.1 ${cmd}`.split(' '), {
const {status} = spawnSync('npx', `-y firebase-tools@13.15.1 ${cmd}`.split(' '), {
cwd,
encoding: 'utf-8',
shell: true,
@ -113,4 +113,8 @@ function firebase(cmd: string, cwd?: string) {
GOOGLE_APPLICATION_CREDENTIALS: getCredentialFilePath(),
},
});
if (status !== 0) {
console.error('Firebase command failed, see log above for details.');
process.exit(status);
}
}

View file

@ -33485,7 +33485,7 @@ async function setupRedirect(deployment) {
await rm(tmpRedirectDir, { recursive: true });
}
function firebase(cmd, cwd) {
spawnSync("npx", `-y firebase-tools@13.15.1 ${cmd}`.split(" "), {
const { status } = spawnSync("npx", `-y firebase-tools@13.15.1 ${cmd}`.split(" "), {
cwd,
encoding: "utf-8",
shell: true,
@ -33495,6 +33495,10 @@ function firebase(cmd, cwd) {
GOOGLE_APPLICATION_CREDENTIALS: getCredentialFilePath()
}
});
if (status !== 0) {
console.error("Firebase command failed, see log above for details.");
process.exit(status);
}
}
//

View file

@ -2,6 +2,7 @@
"compilerOptions": {
"module": "NodeNext",
"target": "ES2021",
"types": ["node"],
"lib": ["es2021"],
"experimentalDecorators": true,
"strict": true,
@ -11,6 +12,5 @@
"noImplicitReturns": true,
"declaration": true,
"sourceMap": true
}
}