Compare commits

...

2 Commits

Author SHA1 Message Date
Marco
b75a0be237
Merge 0eb01d12a1 into 8469c94c6a 2024-10-09 10:47:52 +02:00
Napster134
0eb01d12a1 Adjust storage warning 2024-02-23 14:56:53 -08:00
4 changed files with 12 additions and 8 deletions

View File

@ -189,12 +189,13 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
if (core.isDebug()) { if (core.isDebug()) {
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit const fileSizeMultiplierGb = 10 // 10GB per repo limit
const fileSizeLimit = fileSizeMultiplierGb * 1024 * 1024 * 1024;
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
// For GHES, this check will take place in ReserveCache API with enterprise file size limit // For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the ${fileSizeMultiplierGb}GB limit, not saving cache.`);
} }
core.debug('Reserving Cache'); core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {

View File

@ -189,12 +189,13 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
if (core.isDebug()) { if (core.isDebug()) {
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit const fileSizeMultiplierGb = 10 // 10GB per repo limit
const fileSizeLimit = fileSizeMultiplierGb * 1024 * 1024 * 1024;
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
// For GHES, this check will take place in ReserveCache API with enterprise file size limit // For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the ${fileSizeMultiplierGb}GB limit, not saving cache.`);
} }
core.debug('Reserving Cache'); core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {

View File

@ -189,12 +189,13 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
if (core.isDebug()) { if (core.isDebug()) {
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit const fileSizeMultiplierGb = 10 // 10GB per repo limit
const fileSizeLimit = fileSizeMultiplierGb * 1024 * 1024 * 1024;
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
// For GHES, this check will take place in ReserveCache API with enterprise file size limit // For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the ${fileSizeMultiplierGb}GB limit, not saving cache.`);
} }
core.debug('Reserving Cache'); core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {

5
dist/save/index.js vendored
View File

@ -189,12 +189,13 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
if (core.isDebug()) { if (core.isDebug()) {
yield (0, tar_1.listTar)(archivePath, compressionMethod); yield (0, tar_1.listTar)(archivePath, compressionMethod);
} }
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit const fileSizeMultiplierGb = 10 // 10GB per repo limit
const fileSizeLimit = fileSizeMultiplierGb * 1024 * 1024 * 1024;
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
core.debug(`File Size: ${archiveFileSize}`); core.debug(`File Size: ${archiveFileSize}`);
// For GHES, this check will take place in ReserveCache API with enterprise file size limit // For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) { if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the ${fileSizeMultiplierGb}GB limit, not saving cache.`);
} }
core.debug('Reserving Cache'); core.debug('Reserving Cache');
const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {