From a26e1fb6b3c5ecb4f58b7bba1aca32bd3091338f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 11 Feb 2023 13:33:24 +0100 Subject: [PATCH] Do not show a stacktrace if a process failed, only the message * The stacktrace is confusing and rarely useful in that case. --- dist/index.js | 6 +++++- index.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 75f8cd9..2279aef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -68753,7 +68753,11 @@ async function run() { try { await setupRuby() } catch (error) { - core.setFailed(error.stack) + if (/\bprocess\b.+\bfailed\b/.test(error.message)) { + core.setFailed(error.message) + } else { + core.setFailed(error.stack) + } } } diff --git a/index.js b/index.js index 12a5289..6440290 100644 --- a/index.js +++ b/index.js @@ -23,7 +23,11 @@ export async function run() { try { await setupRuby() } catch (error) { - core.setFailed(error.stack) + if (/\bprocess\b.+\bfailed\b/.test(error.message)) { + core.setFailed(error.message) + } else { + core.setFailed(error.stack) + } } }