diff --git a/src/save.ts b/src/save.ts index dae4a27..4f1c3c4 100644 --- a/src/save.ts +++ b/src/save.ts @@ -1,5 +1,6 @@ import * as core from "@actions/core"; -import * as exec from "@actions/exec"; +import { execFile } from "child_process"; +import { promisify } from "util"; import { cleanBin, cleanGit, cleanRegistry, cleanTargetDir } from "./cleanup.js"; import { CacheConfig, isCacheUpToDate } from "./config.js"; @@ -94,6 +95,6 @@ async function macOsWorkaround() { try { // Workaround for https://github.com/actions/cache/issues/403 // Also see https://github.com/rust-lang/cargo/issues/8603 - await exec.exec("sudo", ["/usr/sbin/purge"], { silent: true }); + await promisify(execFile)("sudo", ["/usr/sbin/purge"]); } catch {} }