12
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2026-05-19 05:51:53 +00:00

Mask each line of multi-line secrets (#208)

* Mask each line of multi-line secrets

* Don't include carriage return characters in masking

* Update CHANGELOG.md
This commit is contained in:
Tom Proctor 2021-05-05 11:54:07 +01:00 committed by GitHub
parent f60544fbda
commit 3526e1be65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 2 deletions

View file

@ -77,8 +77,12 @@ async function exportSecrets() {
const { value, request, cachedResponse } = result;
if (cachedResponse) {
core.debug(' using cached response');
}
command.issue('add-mask', value);
}
for (const line of value.replace(/\r/g, '').split('\n')) {
if (line.length > 0) {
command.issue('add-mask', line);
}
}
if (exportEnv) {
core.exportVariable(request.envVarName, `${value}`);
}