3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-11-07 16:05:05 +00:00

Allow opting out of caching $CARGO_HOME/bin. (#216)

Prevents wiping the bin directory, which is harmful for
self-hosted runners.
This commit is contained in:
Benjy Weinberger 2024-12-09 23:47:51 -08:00 committed by GitHub
parent 9a2e0d3212
commit e8e63cdbf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 59 additions and 15 deletions

View file

@ -56,11 +56,13 @@ async function run() {
core.debug(`${(e as any).stack}`);
}
try {
core.info(`... Cleaning cargo/bin ...`);
await cleanBin(config.cargoBins);
} catch (e) {
core.debug(`${(e as any).stack}`);
if (config.cacheBin) {
try {
core.info(`... Cleaning cargo/bin ...`);
await cleanBin(config.cargoBins);
} catch (e) {
core.debug(`${(e as any).stack}`);
}
}
try {