Skip to content

Commit

Permalink
fix: cache file missmatch
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Oct 13, 2024
1 parent 8fc8809 commit 1bfaa16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/github/cache.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import * as core from "@actions/core";
import * as cache from "@actions/cache";
import * as github from "@actions/github";
import { VMDAnalysis } from "../types.js";
import { parseAnalysisOutput } from "../helpers/parser.js";

const workflow: string = github.context.workflow;

export async function saveCache(
filePath: string,
branch: string
): Promise<void> {
const cacheId: string = `vmd-analysis-${branch}`;
const cacheId: string = `vmd-analysis-${branch}-${workflow}`;
const cachePaths: string[] = [filePath];
try {
await cache.saveCache(cachePaths, cacheId);
Expand All @@ -20,7 +23,7 @@ export async function restoreCache(
branch: string,
cachePath: string
): Promise<VMDAnalysis | undefined> {
const cacheId: string = `vmd-analysis-${branch}`;
const cacheId: string = `vmd-analysis-${branch}-${workflow}`;
try {
const cacheKey: string | undefined = await cache.restoreCache(
[cachePath],
Expand Down

0 comments on commit 1bfaa16

Please sign in to comment.