mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-05-10 19:19:54 +02:00
Format cache size and display on info
This commit is contained in:
parent
bc821d0c12
commit
97bd406ab6
3 changed files with 11 additions and 3 deletions
|
@ -72,7 +72,11 @@ async function run() {
|
|||
await cacheHttpClient.downloadCache(cacheEntry, archivePath);
|
||||
|
||||
const archiveFileSize = utils.getArchiveFileSize(archivePath);
|
||||
core.debug(`File Size: ${archiveFileSize}`);
|
||||
core.info(
|
||||
`Cache Size: ~${Math.round(
|
||||
archiveFileSize / (1024 * 1024)
|
||||
)} MB (${archiveFileSize} B)`
|
||||
);
|
||||
|
||||
io.mkdirP(cachePath);
|
||||
|
||||
|
|
|
@ -59,7 +59,9 @@ async function run() {
|
|||
core.debug(`File Size: ${archiveFileSize}`);
|
||||
if (archiveFileSize > fileSizeLimit) {
|
||||
core.warning(
|
||||
`Cache size of ${archiveFileSize} bytes is over the 400MB limit, not saving cache.`
|
||||
`Cache size of ~${Math.round(
|
||||
archiveFileSize / (1024 * 1024)
|
||||
)} MB (${archiveFileSize} B) is over the 400MB limit, not saving cache.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue