Merge pull request #41 from step-security/annotations

Add annotations
This commit is contained in:
Varun Sharma 2021-12-22 07:41:58 -08:00 committed by GitHub
commit bb7f4132a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1716 additions and 21 deletions

1712
dist/post/index.js vendored

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

2
dist/pre/index.js vendored
View file

@ -6315,7 +6315,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
const confgStr = JSON.stringify(confg);
external_child_process_.execSync("sudo mkdir -p /home/agent");
external_child_process_.execSync("sudo chown -R $USER /home/agent");
const downloadPath = yield tool_cache.downloadTool("https://github.com/step-security/agent/releases/download/v0.4.3/agent_0.4.3_linux_amd64.tar.gz");
const downloadPath = yield tool_cache.downloadTool("https://github.com/step-security/agent/releases/download/v0.5.2/agent_0.5.2_linux_amd64.tar.gz");
const extractPath = yield tool_cache.extractTar(downloadPath);
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
printInfo(web_url);

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "step-security-harden-runner",
"version": "1.0.4",
"version": "1.1.0",
"description": "GitHub Actions Runtime Security",
"main": "index.js",
"scripts": {

View file

@ -1,5 +1,6 @@
import * as fs from "fs";
import * as cp from "child_process";
import * as core from "@actions/core";
(async () => {
if (process.platform !== "linux") {
@ -30,9 +31,12 @@ import * as cp from "child_process";
}
var log = "/home/agent/agent.log";
console.log("log:");
var content = fs.readFileSync(log, "utf-8");
console.log(content);
if (fs.existsSync(log)) {
console.log("log:");
var content = fs.readFileSync(log, "utf-8");
console.log(content);
}
var status = "/home/agent/agent.status";
if (fs.existsSync(status)) {
console.log("status:");
@ -40,6 +44,15 @@ import * as cp from "child_process";
console.log(content);
}
// write annotations
var annotationsFile = "/home/agent/annotation.log";
if (fs.existsSync(annotationsFile)) {
var content = fs.readFileSync(annotationsFile, "utf-8");
content.split(/\r?\n/).forEach((line) => {
core.error(line);
});
}
if (!fs.existsSync(doneFile)) {
var journalLog = cp.execSync("sudo journalctl -u agent.service", {
encoding: "utf8",

View file

@ -54,7 +54,7 @@ import * as tc from "@actions/tool-cache";
cp.execSync("sudo chown -R $USER /home/agent");
const downloadPath: string = await tc.downloadTool(
"https://github.com/step-security/agent/releases/download/v0.4.3/agent_0.4.3_linux_amd64.tar.gz"
"https://github.com/step-security/agent/releases/download/v0.5.2/agent_0.5.2_linux_amd64.tar.gz"
);
const extractPath = await tc.extractTar(downloadPath);