From 83d944ba1a4f023ba3dcc5aceea3491bd12b4ca8 Mon Sep 17 00:00:00 2001 From: Richard Simpson Date: Tue, 7 Apr 2020 12:14:02 -0500 Subject: [PATCH] fix: actually allow custom methods --- src/action.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/action.js b/src/action.js index 25e966d..9bfea2c 100644 --- a/src/action.js +++ b/src/action.js @@ -21,8 +21,9 @@ async function exportSecrets() { const secretRequests = parseSecretsInput(secretsInput); const vaultMethod = (core.getInput('method', { required: false }) || 'token').toLowerCase(); - if (!AUTH_METHODS.includes(vaultMethod)) { - throw Error(`Sorry, the authentication method ${vaultMethod} is not currently supported.`); + const authPayload = core.getInput('authPayload', { required: false }); + if (!AUTH_METHODS.includes(vaultMethod) && !authPayload) { + throw Error(`Sorry, the provided authentication method ${vaultMethod} is not currently supported and no custom authPayload was provided.`); } const defaultOptions = {