mirror of
https://github.com/pnpm/action-setup.git
synced 2026-02-24 13:43:08 +08:00
feat: store caching (#188)
* add pnpm store caching * style: format * no semicolons * no star imports * import order * style: no star imports --------- Co-authored-by: khai96_ <hvksmr1996@gmail.com>
This commit is contained in:
19
src/cache-restore/index.ts
Normal file
19
src/cache-restore/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { isFeatureAvailable } from '@actions/cache'
|
||||
import { endGroup, startGroup, warning } from '@actions/core'
|
||||
import { Inputs } from '../inputs'
|
||||
import { runRestoreCache } from './run'
|
||||
|
||||
export async function restoreCache(inputs: Inputs) {
|
||||
if (!inputs.cache) return
|
||||
|
||||
if (!isFeatureAvailable()) {
|
||||
warning('Cache is not available, skipping cache restoration')
|
||||
return
|
||||
}
|
||||
|
||||
startGroup('Restoring cache...')
|
||||
await runRestoreCache(inputs)
|
||||
endGroup()
|
||||
}
|
||||
|
||||
export default restoreCache
|
||||
Reference in New Issue
Block a user