Bump @actions/cache from 2.0.0 to 2.0.1

This commit is contained in:
Daz DeBoer 2022-04-04 21:45:24 -06:00
parent 0e24fa1975
commit 3317bc450c
No known key found for this signature in database
GPG Key ID: DD6B9F0B06683D5D
7 changed files with 30 additions and 35 deletions

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
package-lock.json generated
View File

@ -10,7 +10,7 @@
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@actions/cache": "2.0.0",
"@actions/cache": "2.0.1",
"@actions/core": "1.6.0",
"@actions/exec": "1.1.1",
"@actions/github": "5.0.1",
@ -38,9 +38,9 @@
}
},
"node_modules/@actions/cache": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
"integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.1.tgz",
"integrity": "sha512-GoxSLZFMLpAeHeE7hXqbOz81j+Mpvgs2o8HL2UlFQppXrrNcIsofFGyoH76htcZZPB/876f6NedFr2AS8Xd2Vw==",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
@ -7092,9 +7092,9 @@
},
"dependencies": {
"@actions/cache": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz",
"integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.1.tgz",
"integrity": "sha512-GoxSLZFMLpAeHeE7hXqbOz81j+Mpvgs2o8HL2UlFQppXrrNcIsofFGyoH76htcZZPB/876f6NedFr2AS8Xd2Vw==",
"requires": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",

View File

@ -24,7 +24,7 @@
],
"license": "MIT",
"dependencies": {
"@actions/cache": "2.0.0",
"@actions/cache": "2.0.1",
"@actions/core": "1.6.0",
"@actions/exec": "1.1.1",
"@actions/github": "5.0.1",

View File

@ -26,24 +26,10 @@ index 16b20f7..aea77ba 100644
+ constructor(key: string, size?: number);
+}
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
index dd31592..cbe378a 100644
index 435f74b..7784f47 100644
--- a/node_modules/@actions/cache/lib/cache.js
+++ b/node_modules/@actions/cache/lib/cache.js
@@ -37,6 +37,13 @@ class ReserveCacheError extends Error {
}
}
exports.ReserveCacheError = ReserveCacheError;
+class CacheEntry {
+ constructor(key, size) {
+ this.key = key;
+ this.size = size;
+ }
+}
+exports.CacheEntry = CacheEntry;
function checkPaths(paths) {
if (!paths || paths.length === 0) {
throw new ValidationError(`Path Validation Error: At least one directory or file path is required`);
@@ -93,6 +100,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
@@ -93,6 +93,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
}
const archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
@ -51,7 +37,7 @@ index dd31592..cbe378a 100644
try {
// Download the cache from the cache entry
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
@@ -100,6 +108,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
@@ -100,6 +101,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
yield tar_1.listTar(archivePath, compressionMethod);
}
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
@ -59,7 +45,7 @@ index dd31592..cbe378a 100644
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
yield tar_1.extractTar(archivePath, compressionMethod);
core.info('Cache restored successfully');
@@ -113,7 +122,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
@@ -113,7 +115,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
core.debug(`Failed to delete archive: ${error}`);
}
}
@ -68,7 +54,7 @@ index dd31592..cbe378a 100644
});
}
exports.restoreCache = restoreCache;
@@ -144,6 +153,7 @@ function saveCache(paths, key, options) {
@@ -138,6 +140,7 @@ function saveCache(paths, key, options) {
const archiveFolder = yield utils.createTempDirectory();
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
core.debug(`Archive Path: ${archivePath}`);
@ -76,15 +62,15 @@ index dd31592..cbe378a 100644
try {
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
if (core.isDebug()) {
@@ -151,6 +161,7 @@ function saveCache(paths, key, options) {
@@ -145,6 +148,7 @@ function saveCache(paths, key, options) {
}
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
+ savedEntry.size = archiveFileSize;
core.debug(`File Size: ${archiveFileSize}`);
if (archiveFileSize > fileSizeLimit) {
throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
@@ -167,7 +178,7 @@ function saveCache(paths, key, options) {
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
@@ -176,8 +180,15 @@ function saveCache(paths, key, options) {
core.debug(`Failed to delete archive: ${error}`);
}
}
@ -93,3 +79,12 @@ index dd31592..cbe378a 100644
});
}
exports.saveCache = saveCache;
+class CacheEntry {
+ constructor(key, size) {
+ this.key = key;
+ this.size = size;
+ }
+}
+exports.CacheEntry = CacheEntry;
//# sourceMappingURL=cache.js.map
\ No newline at end of file