Do not show a stacktrace if a process failed, only the message

* The stacktrace is confusing and rarely useful in that case.
This commit is contained in:
Benoit Daloze
2023-02-11 13:39:22 +01:00
parent 4d060a10e6
commit a26e1fb6b3
2 changed files with 10 additions and 2 deletions
Generated Vendored
+4
View File
@@ -68753,9 +68753,13 @@ async function run() {
try { try {
await setupRuby() await setupRuby()
} catch (error) { } catch (error) {
if (/\bprocess\b.+\bfailed\b/.test(error.message)) {
core.setFailed(error.message)
} else {
core.setFailed(error.stack) core.setFailed(error.stack)
} }
} }
}
// entry point when this action is run from other actions // entry point when this action is run from other actions
async function setupRuby(options = {}) { async function setupRuby(options = {}) {
+4
View File
@@ -23,9 +23,13 @@ export async function run() {
try { try {
await setupRuby() await setupRuby()
} catch (error) { } catch (error) {
if (/\bprocess\b.+\bfailed\b/.test(error.message)) {
core.setFailed(error.message)
} else {
core.setFailed(error.stack) core.setFailed(error.stack)
} }
} }
}
// entry point when this action is run from other actions // entry point when this action is run from other actions
export async function setupRuby(options = {}) { export async function setupRuby(options = {}) {