Emit a diff of each environment variable (#296)

Fixes https://github.com/google-github-actions/auth/issues/295
This commit is contained in:
Seth Vargo 2023-04-17 18:52:00 -04:00 committed by GitHub
parent 430ae13d31
commit 14b54cc192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -299,8 +299,12 @@ async function main() {
function exportVariableAndWarn(key: string, value: string) {
const existing = process.env[key];
if (existing && existing !== value) {
const old = JSON.stringify(existing);
logWarning(`Overwriting existing environment variable ${key} (was: ${old})`);
logWarning(
`Overwriting existing environment variable ${key}:
- ${JSON.stringify(existing)}
+ ${JSON.stringify(value)}
`.trim(),
);
}
exportVariable(key, value);