Add outputs.cache-key

This commit is contained in:
Josh Soref 2022-01-23 13:46:47 -05:00
parent dbb732b211
commit dde36b38ea
8 changed files with 58 additions and 12 deletions

6
dist/save/index.js vendored
View file

@ -4609,6 +4609,7 @@ var Inputs;
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CacheKey"] = "cache-key";
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {
@ -36343,8 +36344,9 @@ function isExactKeyMatch(key, cacheKey) {
}) === 0);
}
exports.isExactKeyMatch = isExactKeyMatch;
function setCacheState(state) {
function setCacheState(state, key) {
core.saveState(constants_1.State.CacheMatchedKey, state);
core.setOutput(constants_1.Outputs.CacheKey, key);
}
exports.setCacheState = setCacheState;
function setCacheHitOutput(isCacheHit) {
@ -36354,7 +36356,7 @@ exports.setCacheHitOutput = setCacheHitOutput;
function setOutputAndState(key, cacheKey) {
setCacheHitOutput(isExactKeyMatch(key, cacheKey));
// Store the matched cache key if it exists
cacheKey && setCacheState(cacheKey);
cacheKey && setCacheState(cacheKey, key);
}
exports.setOutputAndState = setOutputAndState;
function getCacheState() {