mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-23 13:13:17 +08:00
* chore: update Prettier settings and add settings for vscode * rollback semi * fix: exclude `dist` from search and lock changes to some files * Added `search.exclude` to ignore `dist/**` during searches. * Configured `files.readonlyInclude` to lock changes to `dist/**`, `bun.lock`, and `package-lock.json`.
18 lines
542 B
TypeScript
18 lines
542 B
TypeScript
import { saveCache } from "@actions/cache";
|
|
import { getState, warning } from "@actions/core";
|
|
import { CacheState } from "./action";
|
|
import { createHash } from "node:crypto";
|
|
(async () => {
|
|
const state: CacheState = JSON.parse(getState("cache"));
|
|
if (state.cacheEnabled && !state.cacheHit) {
|
|
const cacheKey = createHash("sha1").update(state.url).digest("base64");
|
|
|
|
try {
|
|
await saveCache([state.bunPath], cacheKey);
|
|
process.exit(0);
|
|
} catch (error) {
|
|
warning("Failed to save Bun to cache.");
|
|
}
|
|
}
|
|
})();
|