1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-24 04:29:16 +01:00

Renamed output

This commit is contained in:
Sankalp Kotewar 2022-12-14 09:17:49 +00:00 committed by GitHub
parent 075ad790b0
commit c8d01facfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 14 deletions

View file

@ -132,7 +132,7 @@ test("restore with cache found for key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
expect(outputMock).toHaveBeenCalledWith("cache-restore-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", key);
expect(outputMock).toHaveBeenCalledTimes(3);
@ -166,7 +166,7 @@ test("restore with cache found for restore key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
expect(outputMock).toHaveBeenCalledWith("cache-restore-key", restoreKey);
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
expect(outputMock).toHaveBeenCalledTimes(3);

View file

@ -4957,7 +4957,7 @@ var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheRestoreKey"] = "cache-restore-key"; // Output from restore action
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {
@ -9387,7 +9387,7 @@ class NullStateProvider extends StateProviderBase {
constructor() {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {

View file

@ -4957,7 +4957,7 @@ var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheRestoreKey"] = "cache-restore-key"; // Output from restore action
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {
@ -9387,7 +9387,7 @@ class NullStateProvider extends StateProviderBase {
constructor() {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {

View file

@ -4986,7 +4986,7 @@ var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheRestoreKey"] = "cache-restore-key"; // Output from restore action
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {
@ -9416,7 +9416,7 @@ class NullStateProvider extends StateProviderBase {
constructor() {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {

4
dist/save/index.js vendored
View file

@ -4957,7 +4957,7 @@ var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheRestoreKey"] = "cache-restore-key"; // Output from restore action
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {
@ -9387,7 +9387,7 @@ class NullStateProvider extends StateProviderBase {
constructor() {
super(...arguments);
this.stateToOutputMap = new Map([
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
]);
this.setState = (key, value) => {

View file

@ -16,8 +16,8 @@ outputs:
description: 'A boolean value to indicate an exact match was found for the primary key'
cache-primary-key:
description: 'A resolved cache key for which cache match was attempted'
cache-restore-key:
description: 'Restore key which was used to restore the cache. It will not be set in case there was an exact match with primary key itself'
cache-matched-key:
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
runs:
using: 'node16'
main: '../dist/restore-only/index.js'

View file

@ -8,7 +8,7 @@ export enum Inputs {
export enum Outputs {
CacheHit = "cache-hit", // Output from cache, restore action
CachePrimaryKey = "cache-primary-key", // Output from restore action
CacheRestoreKey = "cache-restore-key" // Output from restore action
CacheMatchedKey = "cache-matched-key" // Output from restore action
}
export enum State {

View file

@ -34,7 +34,7 @@ export class StateProvider extends StateProviderBase {
export class NullStateProvider extends StateProviderBase {
stateToOutputMap = new Map<string, string>([
[State.CacheMatchedKey, Outputs.CacheRestoreKey],
[State.CacheMatchedKey, Outputs.CacheMatchedKey],
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
]);