added code to cache cache.txt in post step

This commit is contained in:
h0x0er 2022-09-13 23:13:41 +05:30
commit 167f172cbd

View file

@ -3,6 +3,9 @@ import * as cp from "child_process";
import * as core from "@actions/core";
import * as common from "./common";
import isDocker from "is-docker";
import * as cache from "@actions/cache";
import { cacheFile, cacheKey } from "./cache";
import path from "path";
(async () => {
if (process.platform !== "linux") {
@ -65,6 +68,12 @@ import isDocker from "is-docker";
});
console.log("Service log:");
console.log(journalLog);
const cmd = "sudo";
const args = ["cp", path.join(__dirname, "cache.txt"), cacheFile];
cp.execFileSync(cmd, args);
const cacheResult = await cache.saveCache([cacheFile], cacheKey);
console.log(cacheResult);
}
})();