Skip to content

Commit f91b2a3

Browse files
author
GitHub Actions
committed
chore: Update dist
1 parent dd67c34 commit f91b2a3

File tree

4 files changed

+39
-13
lines changed

4 files changed

+39
-13
lines changed

dist/cleanup/index.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34663,6 +34663,9 @@ function httpRedirectFetch (fetchParams, response) {
3466334663
// https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
3466434664
request.headersList.delete('authorization')
3466534665

34666+
// https://fetch.spec.whatwg.org/#authentication-entries
34667+
request.headersList.delete('proxy-authorization', true)
34668+
3466634669
// "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
3466734670
request.headersList.delete('cookie')
3466834671
request.headersList.delete('host')
@@ -45733,8 +45736,13 @@ function injectSecret(secretName, secretValue, parseJsonSecrets, tempEnvName) {
4573345736
const secretMap = JSON.parse(secretValue);
4573445737
for (const k in secretMap) {
4573545738
const keyValue = typeof secretMap[k] === 'string' ? secretMap[k] : JSON.stringify(secretMap[k]);
45736-
// Append the current key to the name of the env variable
45737-
const newEnvName = `${tempEnvName || transformToValidEnvName(secretName)}_${transformToValidEnvName(k)}`;
45739+
// Append the current key to the name of the env variable and check to avoid prepending an underscore
45740+
const newEnvName = [
45741+
tempEnvName || transformToValidEnvName(secretName),
45742+
transformToValidEnvName(k)
45743+
]
45744+
.filter(elem => elem) // Uses truthy-ness of elem to determine if it remains
45745+
.join("_"); // Join the remaining elements with an underscore
4573845746
secretsToCleanup = [...secretsToCleanup, ...injectSecret(secretName, keyValue, parseJsonSecrets, newEnvName)];
4573945747
}
4574045748
}
@@ -45810,7 +45818,7 @@ function extractAliasAndSecretIdFromInput(input) {
4581045818
return [alias, secretId];
4581145819
}
4581245820
// No alias
45813-
return ['', input.trim()];
45821+
return [undefined, input.trim()];
4581445822
}
4581545823
exports.extractAliasAndSecretIdFromInput = extractAliasAndSecretIdFromInput;
4581645824
/*

dist/index.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34663,6 +34663,9 @@ function httpRedirectFetch (fetchParams, response) {
3466334663
// https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
3466434664
request.headersList.delete('authorization')
3466534665

34666+
// https://fetch.spec.whatwg.org/#authentication-entries
34667+
request.headersList.delete('proxy-authorization', true)
34668+
3466634669
// "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
3466734670
request.headersList.delete('cookie')
3466834671
request.headersList.delete('host')
@@ -45543,16 +45546,21 @@ function run() {
4554345546
// Get and inject secret values
4554445547
for (let secretId of secretIds) {
4554545548
// Optionally let user set an alias, i.e. `ENV_NAME,secret_name`
45546-
let secretAlias = '';
45549+
let secretAlias = undefined;
4554745550
[secretAlias, secretId] = (0, utils_1.extractAliasAndSecretIdFromInput)(secretId);
4554845551
// Retrieves the secret name also, if the value is an ARN
4554945552
const isArn = (0, utils_1.isSecretArn)(secretId);
4555045553
try {
4555145554
const secretValueResponse = yield (0, utils_1.getSecretValue)(client, secretId);
45552-
if (!secretAlias) {
45555+
const secretValue = secretValueResponse.secretValue;
45556+
// Catch if blank prefix is specified but no json is parsed to avoid blank environment variable
45557+
if ((secretAlias === '') && !(parseJsonSecrets && (0, utils_1.isJSONString)(secretValue))) {
45558+
secretAlias = undefined;
45559+
}
45560+
if (secretAlias === undefined) {
4555345561
secretAlias = isArn ? secretValueResponse.name : secretId;
4555445562
}
45555-
const injectedSecrets = (0, utils_1.injectSecret)(secretAlias, secretValueResponse.secretValue, parseJsonSecrets);
45563+
const injectedSecrets = (0, utils_1.injectSecret)(secretAlias, secretValue, parseJsonSecrets);
4555645564
secretsToCleanup = [...secretsToCleanup, ...injectedSecrets];
4555745565
}
4555845566
catch (err) {
@@ -45739,8 +45747,13 @@ function injectSecret(secretName, secretValue, parseJsonSecrets, tempEnvName) {
4573945747
const secretMap = JSON.parse(secretValue);
4574045748
for (const k in secretMap) {
4574145749
const keyValue = typeof secretMap[k] === 'string' ? secretMap[k] : JSON.stringify(secretMap[k]);
45742-
// Append the current key to the name of the env variable
45743-
const newEnvName = `${tempEnvName || transformToValidEnvName(secretName)}_${transformToValidEnvName(k)}`;
45750+
// Append the current key to the name of the env variable and check to avoid prepending an underscore
45751+
const newEnvName = [
45752+
tempEnvName || transformToValidEnvName(secretName),
45753+
transformToValidEnvName(k)
45754+
]
45755+
.filter(elem => elem) // Uses truthy-ness of elem to determine if it remains
45756+
.join("_"); // Join the remaining elements with an underscore
4574445757
secretsToCleanup = [...secretsToCleanup, ...injectSecret(secretName, keyValue, parseJsonSecrets, newEnvName)];
4574545758
}
4574645759
}
@@ -45816,7 +45829,7 @@ function extractAliasAndSecretIdFromInput(input) {
4581645829
return [alias, secretId];
4581745830
}
4581845831
// No alias
45819-
return ['', input.trim()];
45832+
return [undefined, input.trim()];
4582045833
}
4582145834
exports.extractAliasAndSecretIdFromInput = extractAliasAndSecretIdFromInput;
4582245835
/*

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/utils.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ function injectSecret(secretName, secretValue, parseJsonSecrets, tempEnvName) {
157157
const secretMap = JSON.parse(secretValue);
158158
for (const k in secretMap) {
159159
const keyValue = typeof secretMap[k] === 'string' ? secretMap[k] : JSON.stringify(secretMap[k]);
160-
// Append the current key to the name of the env variable
161-
const newEnvName = `${tempEnvName || transformToValidEnvName(secretName)}_${transformToValidEnvName(k)}`;
160+
// Append the current key to the name of the env variable and check to avoid prepending an underscore
161+
const newEnvName = [
162+
tempEnvName || transformToValidEnvName(secretName),
163+
transformToValidEnvName(k)
164+
]
165+
.filter(elem => elem) // Uses truthy-ness of elem to determine if it remains
166+
.join("_"); // Join the remaining elements with an underscore
162167
secretsToCleanup = [...secretsToCleanup, ...injectSecret(secretName, keyValue, parseJsonSecrets, newEnvName)];
163168
}
164169
}
@@ -234,7 +239,7 @@ function extractAliasAndSecretIdFromInput(input) {
234239
return [alias, secretId];
235240
}
236241
// No alias
237-
return ['', input.trim()];
242+
return [undefined, input.trim()];
238243
}
239244
exports.extractAliasAndSecretIdFromInput = extractAliasAndSecretIdFromInput;
240245
/*

0 commit comments

Comments
 (0)