mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-08 06:17:07 +00:00
added code to cache cache.txt in post step
This commit is contained in:
parent
0ac561d502
commit
167f172cbd
1 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
})();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue