mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
Polish.
This commit is contained in:
parent
293503e099
commit
81acac128f
4 changed files with 20 additions and 22 deletions
10
post.ts
10
post.ts
|
@ -1,17 +1,15 @@
|
|||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import { getPathsToCache, getPrimaryCacheKey } from './helpers';
|
||||
import { CACHE_ENABLED, getPathsToCache, getPrimaryCacheKey } from './helpers';
|
||||
|
||||
async function saveCache() {
|
||||
const enabled = core.getBooleanInput('cache');
|
||||
|
||||
if (!cache.isFeatureAvailable() || !enabled) {
|
||||
if (!CACHE_ENABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const primaryKey = getPrimaryCacheKey();
|
||||
const cacheHitKey = core.getState('cacheHitKey');
|
||||
const cacheHitKey = core.getState('cache-hit-key');
|
||||
|
||||
if (cacheHitKey === primaryKey) {
|
||||
core.info(`Cache hit occured on the key ${cacheHitKey}, not saving cache`);
|
||||
|
@ -24,7 +22,7 @@ async function saveCache() {
|
|||
|
||||
core.info(`Saving cache with key ${primaryKey}`);
|
||||
|
||||
await cache.saveCache(getPathsToCache(), primaryKey, {}, false);
|
||||
await cache.saveCache(getPathsToCache(), primaryKey);
|
||||
}
|
||||
|
||||
async function run() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue