mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-07 07:06:56 +00:00
fix: actually build namespace changes
This commit is contained in:
parent
e394527e23
commit
ab4dc55b2e
1 changed files with 10 additions and 3 deletions
13
dist/index.js
vendored
13
dist/index.js
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue