12
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2026-05-16 21:00:32 +00:00

feat(): make secrets parameter optional (#299)

This commit is contained in:
Kevin Schoonover 2022-04-07 06:10:23 -07:00 committed by GitHub
parent 843e7fa30a
commit c14a190aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 3 deletions

View file

@ -14,7 +14,7 @@ async function exportSecrets() {
const exportEnv = core.getInput('exportEnv', { required: false }) != 'false';
const exportToken = (core.getInput('exportToken', { required: false }) || 'false').toLowerCase() != 'false';
const secretsInput = core.getInput('secrets', { required: true });
const secretsInput = core.getInput('secrets', { required: false });
const secretRequests = parseSecretsInput(secretsInput);
const vaultMethod = (core.getInput('method', { required: false }) || 'token').toLowerCase();
@ -103,6 +103,10 @@ async function exportSecrets() {
* @param {string} secretsInput
*/
function parseSecretsInput(secretsInput) {
if (!secretsInput) {
return []
}
const secrets = secretsInput
.split(';')
.filter(key => !!key)