Skip to content

Commit

Permalink
updated with 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Tiwari committed Mar 24, 2022
1 parent bc53ec5 commit 7e4d931
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 25 deletions.
9 changes: 3 additions & 6 deletions dist/restore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,6 @@ function assertDefined(name, value) {
return value;
}
exports.assertDefined = assertDefined;
function isFeatureAvailable() {
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
//# sourceMappingURL=cacheUtils.js.map

/***/ }),
Expand Down Expand Up @@ -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
// 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 fd = fs.openSync(archivePath, 'w');
try {
Expand Down Expand Up @@ -46460,7 +46457,7 @@ function checkKey(key) {
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
function isFeatureAvailable() {
return utils.isFeatureAvailable();
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/**
Expand Down
18 changes: 6 additions & 12 deletions dist/save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1199,13 +1199,6 @@ function assertDefined(name, value) {
return value;
}
exports.assertDefined = assertDefined;
function isFeatureAvailable() {
if (process.env['ACTIONS_CACHE_URL']) {
return true;
}
return false;
}
exports.isFeatureAvailable = isFeatureAvailable;
//# sourceMappingURL=cacheUtils.js.map

/***/ }),
Expand Down Expand Up @@ -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
// 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 fd = fs.openSync(archivePath, 'w');
try {
Expand Down Expand Up @@ -37532,7 +37526,7 @@ exports.getInputAsInt = getInputAsInt;
function isCacheFeatureAvailable() {
if (!cache.isFeatureAvailable()) {
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 {
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
Expand Down Expand Up @@ -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() {
return utils.isFeatureAvailable();
return !!process.env['ACTIONS_CACHE_URL'];
}
exports.isFeatureAvailable = isFeatureAvailable;
/**
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"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/exec": "^1.1.1",
"@actions/io": "^1.1.2"
Expand Down

0 comments on commit 7e4d931

Please sign in to comment.