mirror of
https://github.com/Swatinem/rust-cache
synced 2025-08-16 09:55:29 +00:00
Only include env vars that are specific to Rust
This commit is contained in:
parent
5f6b32160d
commit
c4f3eceb2f
3 changed files with 37 additions and 3 deletions
13
dist/restore/index.js
vendored
13
dist/restore/index.js
vendored
|
@ -59597,8 +59597,19 @@ async function getCargoBins() {
|
||||||
}
|
}
|
||||||
function getEnvKey() {
|
function getEnvKey() {
|
||||||
const hasher = external_crypto_default().createHash("sha1");
|
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)) {
|
for (const [key, value] of Object.entries(process.env)) {
|
||||||
if (value) {
|
if (validKeys.some((re) => re.test(key)) && value) {
|
||||||
hasher.update(`${key}=${value}`);
|
hasher.update(`${key}=${value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
13
dist/save/index.js
vendored
13
dist/save/index.js
vendored
|
@ -59597,8 +59597,19 @@ async function getCargoBins() {
|
||||||
}
|
}
|
||||||
function getEnvKey() {
|
function getEnvKey() {
|
||||||
const hasher = external_crypto_default().createHash("sha1");
|
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)) {
|
for (const [key, value] of Object.entries(process.env)) {
|
||||||
if (value) {
|
if (validKeys.some((re) => re.test(key)) && value) {
|
||||||
hasher.update(`${key}=${value}`);
|
hasher.update(`${key}=${value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,20 @@ export async function getCargoBins(): Promise<Set<string>> {
|
||||||
|
|
||||||
function getEnvKey(): string {
|
function getEnvKey(): string {
|
||||||
const hasher = crypto.createHash("sha1");
|
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)) {
|
for (const [key, value] of Object.entries(process.env)) {
|
||||||
if (value) {
|
if (validKeys.some((re) => re.test(key)) && value) {
|
||||||
hasher.update(`${key}=${value}`);
|
hasher.update(`${key}=${value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue