mirror of
https://github.com/pnpm/action-setup.git
synced 2026-06-17 08:58:50 +00:00
fix: skip cache save when path is missing
This commit is contained in:
parent
0e279bb959
commit
49997ca1d7
BIN
dist/index.js
vendored
BIN
dist/index.js
vendored
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
import { saveCache } from '@actions/cache'
|
||||
import { getState, info } from '@actions/core'
|
||||
import { existsSync } from 'fs'
|
||||
|
||||
export async function runSaveCache() {
|
||||
const state = getState('cache_restored_key')
|
||||
@ -11,6 +12,11 @@ export async function runSaveCache() {
|
||||
return
|
||||
}
|
||||
|
||||
if (!existsSync(cachePath)) {
|
||||
info(`Cache path ${cachePath} does not exist, not saving cache.`)
|
||||
return
|
||||
}
|
||||
|
||||
const cacheId = await saveCache([cachePath], primaryKey)
|
||||
if (cacheId == -1) return
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user