Fixed review comments and tests

This commit is contained in:
Sankalp Kotewar 2022-12-12 07:26:18 +00:00 committed by GitHub
parent 5e7f2c1182
commit 91d7bd61be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 76 additions and 72 deletions

12
dist/restore/index.js vendored
View file

@ -4943,7 +4943,7 @@ exports.checkBypass = checkBypass;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stateToOutputMap = exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
var Inputs;
(function (Inputs) {
Inputs["Key"] = "key";
@ -4969,10 +4969,6 @@ var Events;
Events["PullRequest"] = "pull_request";
})(Events = exports.Events || (exports.Events = {}));
exports.RefKey = "GITHUB_REF";
exports.stateToOutputMap = new Map([
[State.CacheMatchedKey, Outputs.CacheRestoreKey],
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
]);
/***/ }),
@ -9388,8 +9384,12 @@ exports.StateProvider = StateProvider;
class NullStateProvider extends StateProviderBase {
constructor() {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {
core.setOutput(constants_1.stateToOutputMap.get(key), value);
core.setOutput(this.stateToOutputMap.get(key), value);
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
this.getState = (key) => "";