mirror of
https://github.com/hashicorp/vault-action.git
synced 2026-05-07 02:24:44 +00:00
fix prefixless queries to default to data
This commit is contained in:
parent
7b3e2a5aac
commit
272c40f535
5 changed files with 7428 additions and 5712 deletions
|
|
@ -75,7 +75,10 @@ async function exportSecrets() {
|
|||
const results = await getSecrets(requests, client);
|
||||
|
||||
for (const result of results) {
|
||||
const { value, request } = result;
|
||||
const { value, request, cachedResponse } = result;
|
||||
if (cachedResponse) {
|
||||
core.debug('ℹ using cached response');
|
||||
}
|
||||
command.issue('add-mask', value);
|
||||
if (exportEnv) {
|
||||
core.exportVariable(request.envVarName, `${value}`);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,10 @@ async function getSecrets(secretRequests, client) {
|
|||
*/
|
||||
function selectData(data, selector) {
|
||||
let result = JSON.stringify(jsonata(selector).evaluate(data));
|
||||
// Compat for custom engines
|
||||
if (!result && !selector.includes('.') && selector !== 'data' && 'data' in data) {
|
||||
result = JSON.stringify(jsonata(`data.${selector}`).evaluate(data));
|
||||
}
|
||||
if (result.startsWith(`"`)) {
|
||||
result = result.substring(1, result.length - 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue