diff --git a/dist/restore/index.js b/dist/restore/index.js index f8069d3..e1550d8 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -59597,8 +59597,19 @@ async function getCargoBins() { } function getEnvKey() { const hasher = external_crypto_default().createHash("sha1"); + const validKeys = [ + /^CARGO_.+$/, + /^CC_.+$/, + /^CXX_.+$/, + /^RUSTC_.+$/, + /^RUSTC$/, + /^RUSTDOC$/, + /^RUSTDOCFLAGS$/, + /^RUSTFLAGS$/, + /^RUSTFMT$/, + ]; for (const [key, value] of Object.entries(process.env)) { - if (value) { + if (validKeys.some((re) => re.test(key)) && value) { hasher.update(`${key}=${value}`); } } diff --git a/dist/save/index.js b/dist/save/index.js index be0df7c..2ca6491 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -59597,8 +59597,19 @@ async function getCargoBins() { } function getEnvKey() { const hasher = external_crypto_default().createHash("sha1"); + const validKeys = [ + /^CARGO_.+$/, + /^CC_.+$/, + /^CXX_.+$/, + /^RUSTC_.+$/, + /^RUSTC$/, + /^RUSTDOC$/, + /^RUSTDOCFLAGS$/, + /^RUSTFLAGS$/, + /^RUSTFMT$/, + ]; for (const [key, value] of Object.entries(process.env)) { - if (value) { + if (validKeys.some((re) => re.test(key)) && value) { hasher.update(`${key}=${value}`); } } diff --git a/src/common.ts b/src/common.ts index 83ba944..63236b9 100644 --- a/src/common.ts +++ b/src/common.ts @@ -108,8 +108,20 @@ export async function getCargoBins(): Promise> { function getEnvKey(): string { const hasher = crypto.createHash("sha1"); + const validKeys = [ + /^CARGO_.+$/, + /^CC_.+$/, + /^CXX_.+$/, + /^RUSTC_.+$/, + /^RUSTC$/, + /^RUSTDOC$/, + /^RUSTDOCFLAGS$/, + /^RUSTFLAGS$/, + /^RUSTFMT$/, + ]; + for (const [key, value] of Object.entries(process.env)) { - if (value) { + if (validKeys.some((re) => re.test(key)) && value) { hasher.update(`${key}=${value}`); } }