From ab4dc55b2ecc6eb5926c5caffa45eaf0c3ad735a Mon Sep 17 00:00:00 2001 From: Richard Simpson Date: Thu, 9 Jan 2020 10:31:15 -0600 Subject: [PATCH 1/2] fix: actually build namespace changes --- dist/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 647a6b0..9ad7e22 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3749,17 +3749,23 @@ const got = __webpack_require__(798); async function exportSecrets() { const vaultUrl = core.getInput('url', { required: true }); const vaultToken = core.getInput('token', { required: true }); + const vaultNamespace = core.getInput('namespace', { required: false }); const secretsInput = core.getInput('secrets', { required: true }); const secrets = parseSecretsInput(secretsInput); for (const secret of secrets) { const { secretPath, outputName, secretKey } = secret; - const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, { + const requestOptions = { headers: { 'X-Vault-Token': vaultToken - } - }); + }}; + + if (vaultNamespace != null){ + requestOptions.headers["X-Vault-Namespace"] = vaultNamespace + } + + const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, requestOptions); const parsedResponse = JSON.parse(result.body); const vaultKeyData = parsedResponse.data; @@ -3837,6 +3843,7 @@ module.exports = { normalizeOutputKey }; + /***/ }), /***/ 761: From 7a9634236c037dc79d44b27f23c1510e9e1e7cd7 Mon Sep 17 00:00:00 2001 From: Richard Simpson Date: Thu, 9 Jan 2020 10:45:52 -0600 Subject: [PATCH 2/2] chore(build): re-enable builds on PR and restrict publish to master --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da62f0f..4f7665d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,8 @@ -on: [push] +on: + push: + branches: + - master + pull_request: jobs: build: @@ -119,6 +123,7 @@ jobs: run: npm run test:e2e publish: + if: github.event_name == 'push' && contains(github.ref, 'master') runs-on: ubuntu-latest needs: [build, integration, e2e] steps: