Skip to content

Commit

Permalink
Fix opam download cache key on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Dec 5, 2024
1 parent 260dbdc commit 0e2a6a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/post/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/setup-ocaml/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ async function composeOpamCacheKeys() {
}

async function composeOpamDownloadCacheKeys() {
const isWin = PLATFORM === "windows";
const ocamlCompiler = await RESOLVED_COMPILER;
const repositoryUrls = OPAM_REPOSITORIES.map(([_, value]) => value).join(",");
const plainKey = [ocamlCompiler, repositoryUrls].join(",");
const plainKey = [isWin, ocamlCompiler, repositoryUrls].join(",");
const hash = crypto.createHash("sha256").update(plainKey).digest("hex");
const { runId } = github.context;
const key = `${CACHE_PREFIX}-setup-ocaml-opam-download-${hash}-${runId}`;
Expand Down

0 comments on commit 0e2a6a1

Please sign in to comment.