remove output setting (#22)

Relates: #21
This commit is contained in:
Denis Isaev
2020-05-23 12:34:30 +03:00
committed by GitHub
parent 3395f777a4
commit 8870cfbcd4
5 changed files with 3 additions and 53 deletions

View File

@ -83,8 +83,6 @@ export async function restoreCache(): Promise<void> {
}
// Store the matched cache key
utils.setCacheState(cacheKey)
const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey)
utils.setCacheHitOutput(isExactKeyMatch)
core.info(`Restored cache for golangci-lint from key '${primaryKey}' in ${Date.now() - startedAt}ms`)
} catch (error) {
if (error.name === cache.ValidationError.name) {

View File

@ -4,10 +4,6 @@ export enum Inputs {
RestoreKeys = "restore-keys",
}
export enum Outputs {
CacheHit = "cache-hit",
}
export enum State {
CachePrimaryKey = "CACHE_KEY",
CacheMatchedKey = "CACHE_RESULT",

View File

@ -1,6 +1,6 @@
import * as core from "@actions/core"
import { Outputs, RefKey, State } from "../constants"
import { RefKey, State } from "../constants"
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
return !!(
@ -15,16 +15,6 @@ export function setCacheState(state: string): void {
core.saveState(State.CacheMatchedKey, state)
}
export function setCacheHitOutput(isCacheHit: boolean): void {
core.setOutput(Outputs.CacheHit, isCacheHit.toString())
}
export function setOutputAndState(key: string, cacheKey?: string): void {
setCacheHitOutput(isExactKeyMatch(key, cacheKey))
// Store the matched cache key if it exists
cacheKey && setCacheState(cacheKey)
}
export function getCacheState(): string | undefined {
const cacheKey = core.getState(State.CacheMatchedKey)
if (cacheKey) {