Fix workflow

This commit is contained in:
Ashcon Partovi
2024-04-22 17:50:27 -07:00
parent dc78043603
commit 0f57de0897
4 changed files with 20 additions and 14 deletions

View File

@@ -10,12 +10,14 @@ const restoreKeys = getMultilineInput("restore-keys");
const cacheDir = getInput("cache-dir") || join(tmpdir(), ".github", "cache");
export async function restoreCache() {
console.log("Restoring cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {
return await restoreGithubCache([path], key, restoreKeys);
const cacheKey = await restoreGithubCache([path], key, restoreKeys);
return {
cacheHit: !!cacheKey,
cacheKey: cacheKey ?? key,
};
} catch (error) {
console.error("Failed to restore cache:", error);
return null;
@@ -69,8 +71,6 @@ export async function restoreCache() {
}
export async function saveCache() {
console.log("Saving cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {

View File

@@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs";
import {tmpdir} from "node:os";
import {join} from "node:path";
async function restoreCache() {
console.log("Restoring cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {
return await cache.restoreCache([path], key, restoreKeys);
const cacheKey = await cache.restoreCache([path], key, restoreKeys);
return {
cacheHit: !!cacheKey,
cacheKey: cacheKey ?? key
};
} catch (error) {
console.error("Failed to restore cache:", error);
return null;
@@ -69683,7 +69686,6 @@ async function restoreCache() {
return null;
}
async function saveCache() {
console.log("Saving cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {

View File

@@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs";
import {tmpdir} from "node:os";
import {join} from "node:path";
async function restoreCache() {
console.log("Restoring cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {
return await cache.restoreCache([path], key, restoreKeys);
const cacheKey = await cache.restoreCache([path], key, restoreKeys);
return {
cacheHit: !!cacheKey,
cacheKey: cacheKey ?? key
};
} catch (error) {
console.error("Failed to restore cache:", error);
return null;
@@ -69683,7 +69686,6 @@ async function restoreCache() {
return null;
}
async function saveCache() {
console.log("Saving cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {

View File

@@ -69631,11 +69631,14 @@ import {cpSync, existsSync, mkdirSync, readdirSync} from "node:fs";
import {tmpdir} from "node:os";
import {join} from "node:path";
async function restoreCache() {
console.log("Restoring cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {
return await cache.restoreCache([path], key, restoreKeys);
const cacheKey = await cache.restoreCache([path], key, restoreKeys);
return {
cacheHit: !!cacheKey,
cacheKey: cacheKey ?? key
};
} catch (error) {
console.error("Failed to restore cache:", error);
return null;
@@ -69683,7 +69686,6 @@ async function restoreCache() {
return null;
}
async function saveCache() {
console.log("Saving cache...");
if (isGithubHosted()) {
console.log("Using GitHub cache...");
try {