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
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}`);
}