Update action.ts

This commit is contained in:
Daniil Zotov 2024-09-29 17:39:04 +03:00 committed by GitHub
parent 68fd46c4a3
commit aea58ec4e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import { createHash } from "node:crypto";
import { homedir } from "node:os";
import { join } from "node:path";
import {
@ -73,7 +74,11 @@ export default async (options: Input): Promise<Output> => {
let revision: string | undefined;
let cacheHit = false;
if (cacheEnabled) {
const cacheRestored = await restoreCache([bunPath], url);
const cacheKey = createHash('sha1')
.update(url)
.digest('base64');
const cacheRestored = await restoreCache([bunPath], cacheKey);
if (cacheRestored) {
revision = await getRevision(bunPath);
if (revision) {