12
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2026-05-21 14:52:18 +00:00

feat: added double asterisk wildcard selector to prevent uppercasing of keys before exporting envs (#545)

* feat: added double asterisk wildcard selector to prevent uppercasing of keys before exporting envs

* chore: update changelog

---------

Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
This commit is contained in:
Rory 2025-03-03 23:31:00 +02:00 committed by GitHub
parent 4b1f32b395
commit 7709c60978
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 69 additions and 20 deletions

View file

@ -3,12 +3,12 @@
* @param {string} dataKey
* @param {boolean=} isEnvVar
*/
function normalizeOutputKey(dataKey, isEnvVar = false) {
function normalizeOutputKey(dataKey, upperCase = false) {
let outputKey = dataKey
.replace(".", "__")
.replace(new RegExp("-", "g"), "")
.replace(/[^\p{L}\p{N}_-]/gu, "");
if (isEnvVar) {
if (upperCase) {
outputKey = outputKey.toUpperCase();
}
return outputKey;