1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-24 04:29:16 +01:00

updated with 2.0

This commit is contained in:
Shubham Tiwari 2022-03-25 01:57:45 +05:30
parent bc53ec57f3
commit 7e4d931f67
4 changed files with 16 additions and 25 deletions

View file

@ -1199,10 +1199,6 @@ function assertDefined(name, value) {
return value; return value;
} }
exports.assertDefined = assertDefined; exports.assertDefined = assertDefined;
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
//# sourceMappingURL=cacheUtils.js.map //# sourceMappingURL=cacheUtils.js.map
/***/ }), /***/ }),
@ -5520,7 +5516,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
// //
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments // on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH; // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength); const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w'); const fd = fs.openSync(archivePath, 'w');
try { try {
@ -46460,7 +46457,7 @@ function checkKey(key) {
* @returns boolean return true if Actions cache service feature is available, otherwise false * @returns boolean return true if Actions cache service feature is available, otherwise false
*/ */
function isFeatureAvailable() { function isFeatureAvailable() {
return utils.isFeatureAvailable(); return !!process.env['ACTIONS_CACHE_URL'];
} }
exports.isFeatureAvailable = isFeatureAvailable; exports.isFeatureAvailable = isFeatureAvailable;
/** /**

18
dist/save/index.js vendored
View file

@ -1199,13 +1199,6 @@ function assertDefined(name, value) {
return value; return value;
} }
exports.assertDefined = assertDefined; exports.assertDefined = assertDefined;
function isFeatureAvailable() {
if (process.env['ACTIONS_CACHE_URL']) {
return true;
}
return false;
}
exports.isFeatureAvailable = isFeatureAvailable;
//# sourceMappingURL=cacheUtils.js.map //# sourceMappingURL=cacheUtils.js.map
/***/ }), /***/ }),
@ -5523,7 +5516,8 @@ function downloadCacheStorageSDK(archiveLocation, archivePath, options) {
// //
// If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB
// on 64-bit systems), split the download into multiple segments // on 64-bit systems), split the download into multiple segments
const maxSegmentSize = buffer.constants.MAX_LENGTH; // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.
const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH);
const downloadProgress = new DownloadProgress(contentLength); const downloadProgress = new DownloadProgress(contentLength);
const fd = fs.openSync(archivePath, 'w'); const fd = fs.openSync(archivePath, 'w');
try { try {
@ -37532,7 +37526,7 @@ exports.getInputAsInt = getInputAsInt;
function isCacheFeatureAvailable() { function isCacheFeatureAvailable() {
if (!cache.isFeatureAvailable()) { if (!cache.isFeatureAvailable()) {
if (isGhes()) { if (isGhes()) {
logWarning("Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if ArtifactCache service is enabled or not."); logWarning("Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.");
} }
else { else {
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."); logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
@ -46551,12 +46545,12 @@ function checkKey(key) {
} }
} }
/** /**
* isFeatureAvailable to check the presence of Artifact cache service * isFeatureAvailable to check the presence of Actions cache service
* *
* @returns boolean return true if Artifact cache service is available, otherwise false * @returns boolean return true if Actions cache service feature is available, otherwise false
*/ */
function isFeatureAvailable() { function isFeatureAvailable() {
return utils.isFeatureAvailable(); return !!process.env['ACTIONS_CACHE_URL'];
} }
exports.isFeatureAvailable = isFeatureAvailable; exports.isFeatureAvailable = isFeatureAvailable;
/** /**

12
package-lock.json generated
View file

@ -9,7 +9,7 @@
"version": "3.0.0", "version": "3.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "file:actions-cache-1.0.11.tgz", "@actions/cache": "file:actions-cache-2.0.0.tgz",
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2" "@actions/io": "^1.1.2"
@ -36,9 +36,9 @@
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "1.0.11", "version": "2.0.0",
"resolved": "file:actions-cache-1.0.11.tgz", "resolved": "file:actions-cache-2.0.0.tgz",
"integrity": "sha512-75iLe49HLOPVcHtRUkmyRgYIw8dn0FpHnFSUx/priDggh/QwewM5583a+5JappQBThOhTF/nSVIEbozIIf19Ng==", "integrity": "sha512-vH0mYHv/krPDGjrAU17OfhMghEtWtYTRqBtA2bl0rHZiK28Vy+ZuU3Ul+grf066zrQvF/xrGe/BQ8QM/ZKuzhw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
@ -7300,8 +7300,8 @@
}, },
"dependencies": { "dependencies": {
"@actions/cache": { "@actions/cache": {
"version": "file:actions-cache-1.0.11.tgz", "version": "file:actions-cache-2.0.0.tgz",
"integrity": "sha512-75iLe49HLOPVcHtRUkmyRgYIw8dn0FpHnFSUx/priDggh/QwewM5583a+5JappQBThOhTF/nSVIEbozIIf19Ng==", "integrity": "sha512-vH0mYHv/krPDGjrAU17OfhMghEtWtYTRqBtA2bl0rHZiK28Vy+ZuU3Ul+grf066zrQvF/xrGe/BQ8QM/ZKuzhw==",
"requires": { "requires": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1", "@actions/exec": "^1.0.1",

View file

@ -23,7 +23,7 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "file:actions-cache-1.0.11.tgz", "@actions/cache": "file:actions-cache-2.0.0.tgz",
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2" "@actions/io": "^1.1.2"