From c0cc8dd60a328b0a7d4eca9f31cdae8f89787977 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:28:12 +0000 Subject: [PATCH] added stateprovider changes --- src/stateProvider.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stateProvider.ts b/src/stateProvider.ts index 2578806..3409999 100644 --- a/src/stateProvider.ts +++ b/src/stateProvider.ts @@ -1,6 +1,6 @@ import * as core from "@actions/core"; -import { State, stateToOutputMap } from "./constants"; +import { Outputs, State } from "./constants"; export interface IStateProvider { setState(key: string, value: string): void; @@ -33,8 +33,13 @@ export class StateProvider extends StateProviderBase { } export class NullStateProvider extends StateProviderBase { + stateToOutputMap = new Map([ + [State.CacheMatchedKey, Outputs.CacheRestoreKey], + [State.CachePrimaryKey, Outputs.CachePrimaryKey] + ]); + setState = (key: string, value: string) => { - core.setOutput(stateToOutputMap.get(key) as string, value); + core.setOutput(this.stateToOutputMap.get(key) as string, value); }; // eslint-disable-next-line @typescript-eslint/no-unused-vars getState = (key: string) => "";