From 2259b06d41ab5ed6f2b0a345c864d51c88e206e4 Mon Sep 17 00:00:00 2001 From: Max Wagner <3364111+wagnerm@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:34:51 -0600 Subject: [PATCH] Set output for the error message In the event vault-action throws an error, the error message is sent to the workflow log when with core.setFailed, but that output is not accessible to other steps in the workflow. This change sets an output for the error message, called errorMessage, than can be read by other steps within the workflow and parsed. --- src/entry.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/entry.js b/src/entry.js index b077861..ea764e6 100644 --- a/src/entry.js +++ b/src/entry.js @@ -5,6 +5,7 @@ const { exportSecrets } = require('./action'); try { await core.group('Get Vault Secrets', exportSecrets); } catch (error) { + core.setOutput("errorMessage", error.message); core.setFailed(error.message); } })();