mirror of
https://github.com/pnpm/action-setup.git
synced 2026-03-01 07:51:02 +08:00
20 lines
487 B
TypeScript
20 lines
487 B
TypeScript
import * as cache from '@actions/cache';
|
|
import * as core from '@actions/core';
|
|
import { runRestoreCache } from './run';
|
|
import { Inputs } from '../inputs';
|
|
|
|
export async function restoreCache(inputs: Inputs) {
|
|
if (!inputs.cache) return
|
|
|
|
if (!cache.isFeatureAvailable()) {
|
|
core.warning('Cache is not available, skipping cache restoration')
|
|
return
|
|
}
|
|
|
|
core.startGroup('Restoring cache...')
|
|
await runRestoreCache(inputs);
|
|
core.endGroup();
|
|
}
|
|
|
|
export default restoreCache
|