mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Fix workflow
This commit is contained in:
3
.github/actions/cache/action.mjs
vendored
3
.github/actions/cache/action.mjs
vendored
@@ -74,7 +74,8 @@ export async function saveCache() {
|
||||
if (isGithubHosted()) {
|
||||
console.log("Using GitHub cache...");
|
||||
try {
|
||||
return await saveGithubCache([path], key);
|
||||
const cacheId = await saveGithubCache([path], key);
|
||||
return !!cacheId;
|
||||
} catch (error) {
|
||||
console.error("Failed to save cache:", error);
|
||||
return false;
|
||||
|
||||
3
.github/actions/cache/dist/action.mjs
vendored
3
.github/actions/cache/dist/action.mjs
vendored
@@ -69689,7 +69689,8 @@ async function saveCache() {
|
||||
if (isGithubHosted()) {
|
||||
console.log("Using GitHub cache...");
|
||||
try {
|
||||
return await cache.saveCache([path], key);
|
||||
const cacheId = await cache.saveCache([path], key);
|
||||
return !!cacheId;
|
||||
} catch (error) {
|
||||
console.error("Failed to save cache:", error);
|
||||
return false;
|
||||
|
||||
33
.github/actions/cache/dist/restore/action.mjs
vendored
33
.github/actions/cache/dist/restore/action.mjs
vendored
@@ -69689,7 +69689,8 @@ async function saveCache() {
|
||||
if (isGithubHosted()) {
|
||||
console.log("Using GitHub cache...");
|
||||
try {
|
||||
return await cache.saveCache([path], key);
|
||||
const cacheId = await cache.saveCache([path], key);
|
||||
return !!cacheId;
|
||||
} catch (error) {
|
||||
console.error("Failed to save cache:", error);
|
||||
return false;
|
||||
@@ -69733,21 +69734,19 @@ var cacheDir = core.getInput("cache-dir") || join(tmpdir(), ".github", "cache");
|
||||
// restore/action.mjs
|
||||
var core2 = __toESM(require_core(), 1);
|
||||
async function main() {
|
||||
try {
|
||||
const result = await restoreCache();
|
||||
if (result) {
|
||||
const { cacheHit, cacheKey } = result;
|
||||
console.log("Cache key:", cacheKey, cacheHit ? "(hit)" : "(miss)");
|
||||
core2.setOutput("cache-hit", cacheHit);
|
||||
core2.setOutput("cache-matched-key", cacheKey);
|
||||
if (cacheHit) {
|
||||
core2.setOutput("cache-primary-key", cacheKey);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to restore cache:", error);
|
||||
const result = await restoreCache();
|
||||
if (!result) {
|
||||
process.exit(1);
|
||||
}
|
||||
const { cacheHit, cacheKey } = result;
|
||||
console.log("Cache key:", cacheKey, cacheHit ? "(hit)" : "(miss)");
|
||||
core2.setOutput("cache-hit", cacheHit);
|
||||
core2.setOutput("cache-matched-key", cacheKey);
|
||||
if (cacheHit) {
|
||||
core2.setOutput("cache-primary-key", cacheKey);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
main();
|
||||
main().catch((error) => {
|
||||
console.error("Failed to restore cache:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
22
.github/actions/cache/dist/save/action.mjs
vendored
22
.github/actions/cache/dist/save/action.mjs
vendored
@@ -69689,7 +69689,8 @@ async function saveCache() {
|
||||
if (isGithubHosted()) {
|
||||
console.log("Using GitHub cache...");
|
||||
try {
|
||||
return await cache.saveCache([path], key);
|
||||
const cacheId = await cache.saveCache([path], key);
|
||||
return !!cacheId;
|
||||
} catch (error) {
|
||||
console.error("Failed to save cache:", error);
|
||||
return false;
|
||||
@@ -69732,15 +69733,14 @@ var cacheDir = core.getInput("cache-dir") || join(tmpdir(), ".github", "cache");
|
||||
|
||||
// save/action.mjs
|
||||
async function main() {
|
||||
try {
|
||||
const ok = await saveCache();
|
||||
if (ok) {
|
||||
console.log("Cache saved");
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to restore cache:", error);
|
||||
const saved = await saveCache();
|
||||
if (saved) {
|
||||
console.log("Cache saved");
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
main();
|
||||
main().catch((error) => {
|
||||
console.error("Failed to save cache:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
30
.github/actions/cache/restore/action.mjs
vendored
30
.github/actions/cache/restore/action.mjs
vendored
@@ -2,22 +2,20 @@ import { setOutput } from "@actions/core";
|
||||
import { restoreCache } from "../action.mjs";
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const result = await restoreCache();
|
||||
if (result) {
|
||||
const { cacheHit, cacheKey } = result;
|
||||
console.log("Cache key:", cacheKey, cacheHit ? "(hit)" : "(miss)");
|
||||
setOutput("cache-hit", cacheHit);
|
||||
setOutput("cache-matched-key", cacheKey);
|
||||
if (cacheHit) {
|
||||
setOutput("cache-primary-key", cacheKey);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to restore cache:", error);
|
||||
const result = await restoreCache();
|
||||
if (!result) {
|
||||
process.exit(1);
|
||||
}
|
||||
const { cacheHit, cacheKey } = result;
|
||||
console.log("Cache key:", cacheKey, cacheHit ? "(hit)" : "(miss)");
|
||||
setOutput("cache-hit", cacheHit);
|
||||
setOutput("cache-matched-key", cacheKey);
|
||||
if (cacheHit) {
|
||||
setOutput("cache-primary-key", cacheKey);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
main();
|
||||
main().catch(error => {
|
||||
console.error("Failed to restore cache:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
19
.github/actions/cache/save/action.mjs
vendored
19
.github/actions/cache/save/action.mjs
vendored
@@ -1,16 +1,15 @@
|
||||
import { saveCache } from "../action.mjs";
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const ok = await saveCache();
|
||||
if (ok) {
|
||||
console.log("Cache saved");
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to restore cache:", error);
|
||||
const saved = await saveCache();
|
||||
if (saved) {
|
||||
console.log("Cache saved");
|
||||
} else {
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
main();
|
||||
main().catch(error => {
|
||||
console.error("Failed to save cache:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user