5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-07 15:16:56 +00:00

Set output for the error message (#446)

* 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.

* Add hashicorp/vault-action#446 to improvements in CHANGELOG
This commit is contained in:
Max Wagner 2023-05-19 07:21:14 -06:00 committed by GitHub
parent d1655aec40
commit 1f5b7d55d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -3,6 +3,7 @@
Features: Features:
* Added support for userpass and ldap authentication methods [GH-440](https://github.com/hashicorp/vault-action/pull/440) * Added support for userpass and ldap authentication methods [GH-440](https://github.com/hashicorp/vault-action/pull/440)
* Define an output, `errorMessage`, for vault-action's error messages so subsequent steps can read the errors [GH-446](https://github.com/hashicorp/vault-action/pull/446)
## 2.5.0 (Jan 26th, 2023) ## 2.5.0 (Jan 26th, 2023)

View file

@ -5,6 +5,7 @@ const { exportSecrets } = require('./action');
try { try {
await core.group('Get Vault Secrets', exportSecrets); await core.group('Get Vault Secrets', exportSecrets);
} catch (error) { } catch (error) {
core.setOutput("errorMessage", error.message);
core.setFailed(error.message); core.setFailed(error.message);
} }
})(); })();