mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 13:08:27 +02:00
* fix: use hash instead of url for primary cache key (#102) * Update cache-save.ts * Update action.ts * Update cache-save.ts * build * format * [autofix.ci] apply automated fixes --------- Co-authored-by: Daniil Zotov <142039751+zoto-ff@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
b9d34de66d
commit
a8913c42f4
4 changed files with 67 additions and 61 deletions
|
@ -1,3 +1,4 @@
|
|||
import { createHash } from "node:crypto";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
|
@ -73,7 +74,9 @@ 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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue