File tree 4 files changed +28
-16
lines changed 4 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ function checkKey(key) {
58
58
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
59
59
}
60
60
}
61
+ /**
62
+ * isFeatureAvailable to check the presence of Actions cache service
63
+ *
64
+ * @returns boolean return true if Actions cache service feature is available, otherwise false
65
+ */
66
+ function isFeatureAvailable() {
67
+ return !!process.env['ACTIONS_CACHE_URL'];
68
+ }
69
+ exports.isFeatureAvailable = isFeatureAvailable;
61
70
/**
62
71
* Restores cache from keys
63
72
*
@@ -208,10 +217,7 @@ const options_1 = __nccwpck_require__(6215);
208
217
const requestUtils_1 = __nccwpck_require__(3981);
209
218
const versionSalt = '1.0';
210
219
function getCacheApiUrl(resource) {
211
- // Ideally we just use ACTIONS_CACHE_URL
212
- const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
213
- process.env['ACTIONS_RUNTIME_URL'] ||
214
- '').replace('pipelines', 'artifactcache');
220
+ const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
215
221
if (!baseUrl) {
216
222
throw new Error('Cache Service Url not found, unable to restore cache.');
217
223
}
Original file line number Diff line number Diff line change @@ -58,6 +58,15 @@ function checkKey(key) {
58
58
throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
59
59
}
60
60
}
61
+ /**
62
+ * isFeatureAvailable to check the presence of Actions cache service
63
+ *
64
+ * @returns boolean return true if Actions cache service feature is available, otherwise false
65
+ */
66
+ function isFeatureAvailable() {
67
+ return !!process.env['ACTIONS_CACHE_URL'];
68
+ }
69
+ exports.isFeatureAvailable = isFeatureAvailable;
61
70
/**
62
71
* Restores cache from keys
63
72
*
@@ -208,10 +217,7 @@ const options_1 = __nccwpck_require__(6215);
208
217
const requestUtils_1 = __nccwpck_require__(3981);
209
218
const versionSalt = '1.0';
210
219
function getCacheApiUrl(resource) {
211
- // Ideally we just use ACTIONS_CACHE_URL
212
- const baseUrl = (process.env['ACTIONS_CACHE_URL'] ||
213
- process.env['ACTIONS_RUNTIME_URL'] ||
214
- '').replace('pipelines', 'artifactcache');
220
+ const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';
215
221
if (!baseUrl) {
216
222
throw new Error('Cache Service Url not found, unable to restore cache.');
217
223
}
Original file line number Diff line number Diff line change 24
24
"author" : " golangci" ,
25
25
"license" : " MIT" ,
26
26
"dependencies" : {
27
- "@actions/cache" : " ^1 .0.10 " ,
27
+ "@actions/cache" : " ^2 .0.0 " ,
28
28
"@actions/core" : " ^1.6.0" ,
29
29
"@actions/exec" : " ^1.1.1" ,
30
30
"@actions/github" : " ^5.0.0" ,
You can’t perform that action at this time.
0 commit comments