@@ -672,20 +672,12 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
672672 key,
673673 version
674674 };
675- let signedUploadUrl;
676- try {
677- const response = yield twirpClient.CreateCacheEntry(request);
678- if (!response.ok) {
679- throw new Error('Response was not ok');
680- }
681- signedUploadUrl = response.signedUploadUrl;
682- }
683- catch (error) {
684- core.debug(`Failed to reserve cache: ${error}`);
675+ const response = yield twirpClient.CreateCacheEntry(request);
676+ if (!response.ok) {
685677 throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
686678 }
687679 core.debug(`Attempting to upload cache located at: ${archivePath}`);
688- yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options);
680+ yield cacheHttpClient.saveCache(cacheId, archivePath, response. signedUploadUrl, options);
689681 const finalizeRequest = {
690682 key,
691683 version,
@@ -102364,7 +102356,7 @@ exports.visitAsync = visitAsync;
102364102356/***/ ((module) => {
102365102357
102366102358"use strict";
102367- module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.2","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
102359+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.1","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
102368102360
102369102361/***/ }),
102370102362
@@ -102427,7 +102419,6 @@ const fs = __nccwpck_require__(9896)
102427102419const path = __nccwpck_require__(6928)
102428102420const cache = __nccwpck_require__(5116)
102429102421const core = __nccwpck_require__(7484)
102430- const github = __nccwpck_require__(3228)
102431102422const glob = __nccwpck_require__(7206)
102432102423const config = __nccwpck_require__(700)
102433102424const gc = __nccwpck_require__(1724)
@@ -102506,7 +102497,7 @@ async function saveDiskCache(cacheConfig) {
102506102497 // We don't want to follow symlinks as it's extremely slow on macOS.
102507102498 { followSymbolicLinks: false }
102508102499 )
102509- const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}-${github.context.runId }.${github.context.runAttempt }`
102500+ const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}-${post_process.env.GITHUB_RUN_ID }.${post_process.env.GITHUB_RUN_ATTEMPT }`
102510102501 core.debug(`Attempting to save ${paths} cache to ${key}`)
102511102502 await cache.saveCache(paths, key)
102512102503 core.info('Successfully saved cache')
0 commit comments