mirror of
https://github.com/google-github-actions/auth.git
synced 2026-03-15 09:20:59 -04:00
Emit a diff of each environment variable (#296)
Fixes https://github.com/google-github-actions/auth/issues/295
This commit is contained in:
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -299,8 +299,12 @@ async function main() {
|
|||||||
function exportVariableAndWarn(key: string, value: string) {
|
function exportVariableAndWarn(key: string, value: string) {
|
||||||
const existing = process.env[key];
|
const existing = process.env[key];
|
||||||
if (existing && existing !== value) {
|
if (existing && existing !== value) {
|
||||||
const old = JSON.stringify(existing);
|
logWarning(
|
||||||
logWarning(`Overwriting existing environment variable ${key} (was: ${old})`);
|
`Overwriting existing environment variable ${key}:
|
||||||
|
- ${JSON.stringify(existing)}
|
||||||
|
+ ${JSON.stringify(value)}
|
||||||
|
`.trim(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
exportVariable(key, value);
|
exportVariable(key, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user