Test if it's possible to overwrite env var variable in action

This commit is contained in:
Leonardo Villela 2023-04-24 02:15:24 +02:00
parent 1d767e3957
commit 93d64baa8a
4 changed files with 35 additions and 0 deletions

View file

@ -9,5 +9,6 @@ describe('e2e', () => {
expect(process.env.OTHERALTSECRET).toBe("OTHERCUSTOMSECRET");
expect(process.env.FOO).toBe("bar");
expect(process.env.NAMED_CUBBYSECRET).toBe("zap");
expect(process.env.NESTED_VAULT_ACTION_SECRET).toBe("NESTED_VAULT_ACTION_SECRET");
});
});

View file

@ -76,6 +76,18 @@ const vaultToken = `${process.env.VAULT_TOKEN}` === undefined ? `${process.env.V
zip: 'zap',
},
});
await got(`http://${vaultUrl}/v1/secret/data/nested-vault-action`, {
method: 'POST',
headers: {
'X-Vault-Token': vaultToken,
},
json: {
data: {
secret: 'NESTED_VAULT_ACTION_SECRET',
},
},
});
} catch (error) {
console.log(error);
process.exit(1);