Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way not to include job_id in the cache key ? #127

Closed
Roms1383 opened this issue Mar 29, 2023 · 2 comments
Closed

Is there a way not to include job_id in the cache key ? #127

Roms1383 opened this issue Mar 29, 2023 · 2 comments

Comments

@Roms1383
Copy link

Hi, thanks for all the work on this action!
I was wondering if the job_id could be ignored, since I'd like to reuse cache across a couple of jobs.

@Swatinem
Copy link
Owner

Swatinem commented Apr 8, 2023

You can use a shared-key instead, which will avoid the default job based key.

rust-cache/src/config.ts

Lines 53 to 68 in 6fd3edf

let key = core.getInput("prefix-key") || "v0-rust";
const sharedKey = core.getInput("shared-key");
if (sharedKey) {
key += `-${sharedKey}`;
} else {
const inputKey = core.getInput("key");
if (inputKey) {
key += `-${inputKey}`;
}
const job = process.env.GITHUB_JOB;
if (job) {
key += `-${job}`;
}
}

@Swatinem Swatinem closed this as completed Apr 8, 2023
@Roms1383
Copy link
Author

Roms1383 commented Apr 8, 2023

thanks @Swatinem! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants