From 554fdcd2ec5e7b870363a98c39961a89b621ba89 Mon Sep 17 00:00:00 2001 From: Vladimir Starkov Date: Fri, 31 Jan 2025 13:30:07 +0100 Subject: [PATCH] core.setFailed and core.error to include stack trace to make debugging and triaging easier currently its impossible to know which place in the code caused an error if you have simple syntax errors like `replace is not a function`. and if I get an report of an error with my action, report won't have anything meaningful to mention, which makes triaging process few steps longer than needed --- packages/core/src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 0a141693..8ebd0a7f 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -244,7 +244,7 @@ export function debug(message: string): void { /** * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() + * @param message error issue message. error.stack will be used for Errors * @param properties optional properties to add to the annotation. */ export function error( @@ -254,7 +254,7 @@ export function error( issueCommand( 'error', toCommandProperties(properties), - message instanceof Error ? message.toString() : message + message instanceof Error ? message.stack : message ) }