|
|
@ -2237,8 +2237,6 @@ function createHttpClient() {
|
|
|
|
function getCacheVersion() {
|
|
|
|
function getCacheVersion() {
|
|
|
|
// Add salt to cache version to support breaking changes in cache entry
|
|
|
|
// Add salt to cache version to support breaking changes in cache entry
|
|
|
|
const components = [
|
|
|
|
const components = [
|
|
|
|
core.getInput(constants_1.Inputs.Key, { required: true }),
|
|
|
|
|
|
|
|
core.getInput(constants_1.Inputs.RestoreKeys, { required: false }),
|
|
|
|
|
|
|
|
core.getInput(constants_1.Inputs.Path, { required: true }),
|
|
|
|
core.getInput(constants_1.Inputs.Path, { required: true }),
|
|
|
|
versionSalt
|
|
|
|
versionSalt
|
|
|
|
];
|
|
|
|
];
|
|
|
@ -2248,12 +2246,12 @@ function getCacheVersion() {
|
|
|
|
.digest("hex");
|
|
|
|
.digest("hex");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.getCacheVersion = getCacheVersion;
|
|
|
|
exports.getCacheVersion = getCacheVersion;
|
|
|
|
function getCacheEntry() {
|
|
|
|
function getCacheEntry(keys) {
|
|
|
|
var _a;
|
|
|
|
var _a;
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const httpClient = createHttpClient();
|
|
|
|
const version = getCacheVersion();
|
|
|
|
const version = getCacheVersion();
|
|
|
|
const resource = `cache?version=${version}`;
|
|
|
|
const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`;
|
|
|
|
const response = yield httpClient.getJson(getCacheApiUrl(resource));
|
|
|
|
const response = yield httpClient.getJson(getCacheApiUrl(resource));
|
|
|
|
if (response.statusCode === 204) {
|
|
|
|
if (response.statusCode === 204) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -4588,7 +4586,7 @@ function run() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const cacheEntry = yield cacheHttpClient.getCacheEntry();
|
|
|
|
const cacheEntry = yield cacheHttpClient.getCacheEntry(keys);
|
|
|
|
if (!((_a = cacheEntry) === null || _a === void 0 ? void 0 : _a.archiveLocation)) {
|
|
|
|
if (!((_a = cacheEntry) === null || _a === void 0 ? void 0 : _a.archiveLocation)) {
|
|
|
|
core.info(`Cache not found for input keys: ${keys.join(", ")}`);
|
|
|
|
core.info(`Cache not found for input keys: ${keys.join(", ")}`);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|