Added support to check if Artifact cache service is enabled or not.

This commit is contained in:
Shubham Tiwari
2022-03-23 02:24:43 +05:30
parent d1abf7dc74
commit 717b6fd18b
5 changed files with 22 additions and 10 deletions
+1 -6
View File
@@ -31,12 +31,7 @@ import {
const versionSalt = '1.0'
function getCacheApiUrl(resource: string): string {
// Ideally we just use ACTIONS_CACHE_URL
const baseUrl: string = (
process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
''
).replace('pipelines', 'artifactcache')
const baseUrl: string = process.env['ACTIONS_CACHE_URL'] || ''
if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.')
}