Skip to content

Commit 9bba600

Browse files
Merge pull request #20 from step-security/feature-16
Add color and move link to new line
2 parents 7206db2 + b1777d5 commit 9bba600

File tree

10 files changed

+64
-38
lines changed

10 files changed

+64
-38
lines changed

dist/index.js

Lines changed: 35 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pre/index.js

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pre/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cleanup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as fs from "fs";
1616
while (true) {
1717
if (!fs.existsSync(doneFile)) {
1818
counter++;
19-
if (counter > 30) {
19+
if (counter > 10) {
2020
console.log("timed out");
2121

2222
break;

src/common.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export function printInfo(web_url) {
2+
console.log(
3+
"\x1b[32m%s\x1b[0m",
4+
"View security insights and recommended policy at:"
5+
);
6+
7+
console.log(
8+
`${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}`
9+
);
10+
}

src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1+
import { printInfo } from "./common";
2+
13
(async () => {
24
if (process.platform !== "linux") {
35
console.log("Only runs on linux");
46
return;
57
}
68

79
var web_url = "https://app.stepsecurity.io";
8-
9-
console.log(
10-
`View security insights and recommended policy at ${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]} after the run has finished`
11-
);
10+
printInfo(web_url);
1211
})();

src/setup.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as core from "@actions/core";
2-
import { context } from "@actions/github/lib/utils";
32
import * as cp from "child_process";
43
import * as fs from "fs";
54
import * as https from "https";
65
import * as path from "path";
76
import { v4 as uuidv4 } from "uuid";
7+
import { printInfo } from "./common";
88

99
(async () => {
1010
try {
@@ -43,9 +43,8 @@ import { v4 as uuidv4 } from "uuid";
4343
filePath.close();
4444

4545
console.log(`Step Security Job Correlation ID: ${correlation_id}`);
46-
console.log(
47-
`View security insights and recommended policy at ${web_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]} after the run has finished`
48-
);
46+
printInfo(web_url);
47+
4948
let cmd = "cp",
5049
args = [path.join(__dirname, "agent"), "/home/agent/agent"];
5150
cp.execFileSync(cmd, args);

0 commit comments

Comments
 (0)