diff --git a/dist/restore/index.js b/dist/restore/index.js index 70cccdf..59caf5d 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -1605,7 +1605,6 @@ function uploadChunk(restClient, resourceUrl, data, start, end) { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) }; - core.debug(`Resource URL: ${resourceUrl}`); return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions); }); } @@ -1613,7 +1612,7 @@ function commitCache(restClient, cacheId, filesize) { return __awaiter(this, void 0, void 0, function* () { const requestOptions = getRequestOptions(); const commitCacheRequest = { size: filesize }; - return yield restClient.create(cacheId.toString(), commitCacheRequest, requestOptions); + return yield restClient.create(`caches/${cacheId.toString()}`, commitCacheRequest, requestOptions); }); } function saveCache(cacheId, archivePath) { @@ -1622,7 +1621,7 @@ function saveCache(cacheId, archivePath) { core.debug("Uploading chunks"); // Upload Chunks const fileSize = fs.statSync(archivePath).size; - const resourceUrl = getCacheApiUrl() + cacheId.toString(); + const resourceUrl = getCacheApiUrl() + "caches/" + cacheId.toString(); const uploads = []; let offset = 0; while (offset < fileSize) { diff --git a/dist/save/index.js b/dist/save/index.js index 3c005f5..910ecb5 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -1605,7 +1605,6 @@ function uploadChunk(restClient, resourceUrl, data, start, end) { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) }; - core.debug(`Resource URL: ${resourceUrl}`); return yield restClient.uploadStream("PATCH", resourceUrl, data, requestOptions); }); } @@ -1613,7 +1612,7 @@ function commitCache(restClient, cacheId, filesize) { return __awaiter(this, void 0, void 0, function* () { const requestOptions = getRequestOptions(); const commitCacheRequest = { size: filesize }; - return yield restClient.create(cacheId.toString(), commitCacheRequest, requestOptions); + return yield restClient.create(`caches/${cacheId.toString()}`, commitCacheRequest, requestOptions); }); } function saveCache(cacheId, archivePath) { @@ -1622,7 +1621,7 @@ function saveCache(cacheId, archivePath) { core.debug("Uploading chunks"); // Upload Chunks const fileSize = fs.statSync(archivePath).size; - const resourceUrl = getCacheApiUrl() + cacheId.toString(); + const resourceUrl = getCacheApiUrl() + "caches/" + cacheId.toString(); const uploads = []; let offset = 0; while (offset < fileSize) { diff --git a/src/cacheHttpClient.ts b/src/cacheHttpClient.ts index 119de8e..01d8582 100644 --- a/src/cacheHttpClient.ts +++ b/src/cacheHttpClient.ts @@ -157,7 +157,6 @@ async function uploadChunk( "Content-Range": getContentRange(start, end) }; - core.debug(`Resource URL: ${resourceUrl}`); return await restClient.uploadStream("PATCH", resourceUrl, data, requestOptions); } @@ -169,7 +168,7 @@ async function commitCache( const requestOptions = getRequestOptions(); const commitCacheRequest: CommitCacheRequest = { size: filesize }; return await restClient.create( - cacheId.toString(), + `caches/${cacheId.toString()}`, commitCacheRequest, requestOptions ); @@ -184,7 +183,7 @@ export async function saveCache( core.debug("Uploading chunks"); // Upload Chunks const fileSize = fs.statSync(archivePath).size; - const resourceUrl = getCacheApiUrl() + cacheId.toString(); + const resourceUrl = getCacheApiUrl() + "caches/" + cacheId.toString(); const uploads: Promise>[] = []; let offset = 0; while (offset < fileSize) {