From a06246c9ecec2861fd783cbc19346c7b0cdc1e1a Mon Sep 17 00:00:00 2001 From: Laco Date: Thu, 21 Aug 2025 12:46:13 +0200 Subject: [PATCH] Update error messages to better handle long commands When running this action with large number of environment variables the resulting gcloud command gets very long, and if it fails the error message visible in github actions output is cut off before it gets to the actually useful bit with the error message, making it impossible to tell what went wrong. This adjusts the message the put the command at the end. It's likely less interesting since it's constructed from inputs the user provides anyway. --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index a18900c9..84f33765 100644 --- a/src/main.ts +++ b/src/main.ts @@ -317,7 +317,7 @@ export async function run(): Promise { const errMsg = deployCmdExec.stderr || `command exited ${deployCmdExec.exitCode}, but stderr had no output`; - throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`); + throw new Error(`failed to deploy: ${errMsg}, full command: \`${commandString}\``); } setActionOutputs(parseDeployResponse(deployCmdExec.stdout, { tag: tag })); @@ -328,7 +328,7 @@ export async function run(): Promise { const errMsg = updateTrafficExec.stderr || `command exited ${updateTrafficExec.exitCode}, but stderr had no output`; - throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`); + throw new Error(`failed to update traffic: ${errMsg}, full command: \`${commandString}\``); } setActionOutputs(parseUpdateTrafficResponse(updateTrafficExec.stdout)); }