mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-21 00:03:58 +08:00
Stop warning when cache is not found (#40)
The cache not being found is a common situation so very visible warning is a little too much.
This commit is contained in:
parent
57f889e86e
commit
ce4a52af49
2 changed files with 11 additions and 7 deletions
|
@ -49,14 +49,20 @@ async function run() {
|
|||
}
|
||||
|
||||
try {
|
||||
const cacheEntry = await cacheHttpClient.getCacheEntry(keys);
|
||||
if (!cacheEntry) {
|
||||
core.info(
|
||||
`Cache not found for input keys: ${JSON.stringify(keys)}.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let archivePath = path.join(
|
||||
await utils.createTempDirectory(),
|
||||
"cache.tgz"
|
||||
);
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
|
||||
const cacheEntry = await cacheHttpClient.getCacheEntry(keys);
|
||||
|
||||
// Store the cache result
|
||||
utils.setCacheState(cacheEntry);
|
||||
|
||||
|
@ -92,7 +98,7 @@ async function run() {
|
|||
utils.setCacheHitOutput(isExactKeyMatch);
|
||||
|
||||
core.info(
|
||||
`Cache restored from key:${cacheEntry && cacheEntry.cacheKey}`
|
||||
`Cache restored from key: ${cacheEntry && cacheEntry.cacheKey}`
|
||||
);
|
||||
} catch (error) {
|
||||
core.warning(error.message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue