mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
Update api.
This commit is contained in:
parent
d87f327046
commit
d7d917b850
3 changed files with 32 additions and 20 deletions
9
post.ts
9
post.ts
|
@ -3,7 +3,14 @@ import { saveCache } from './src/cargo';
|
|||
|
||||
async function run() {
|
||||
try {
|
||||
await saveCache();
|
||||
const base = core.getInput('cache-base');
|
||||
|
||||
// Only save the cache for the following 2 scenarios:
|
||||
// - If not using the base warmup strategy.
|
||||
// - If using the base warmup strategy, and the current ref matches.
|
||||
if (!base || (base && !!(process.env.GITHUB_REF_NAME ?? '').match(base))) {
|
||||
await saveCache();
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
core.setFailed((error as Error).message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue