Skip to content

Commit f4e7a3e

Browse files
Merge pull request #24 from step-security/feature-22
Call API to monitor run
2 parents 917f7d5 + 40f1350 commit f4e7a3e

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

dist/pre/index.js

Lines changed: 6 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.

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "step-security-harden-runner",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "GitHub Actions Runtime Security",
55
"main": "index.js",
66
"scripts": {
@@ -25,6 +25,7 @@
2525
"@actions/core": "^1.5.0",
2626
"@actions/exec": "^1.1.0",
2727
"@actions/github": "^5.0.0",
28+
"@actions/http-client": "^1.0.11",
2829
"@actions/tool-cache": "^1.7.1",
2930
"node-fetch": "^2.6.1",
3031
"uuid": "^8.3.2"

src/setup.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from "@actions/core";
22
import * as cp from "child_process";
33
import * as fs from "fs";
4-
import * as https from "https";
4+
import * as httpm from "@actions/http-client";
55
import * as path from "path";
66
import { v4 as uuidv4 } from "uuid";
77
import { printInfo } from "./common";
@@ -19,6 +19,11 @@ import * as tc from "@actions/tool-cache";
1919
var api_url = `https://${env}.api.stepsecurity.io/v1`;
2020
var web_url = "https://app.stepsecurity.io";
2121

22+
let _http = new httpm.HttpClient();
23+
await _http.get(
24+
`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`
25+
);
26+
2227
const confg = {
2328
repo: process.env["GITHUB_REPOSITORY"],
2429
run_id: process.env["GITHUB_RUN_ID"],
@@ -33,7 +38,7 @@ import * as tc from "@actions/tool-cache";
3338
cp.execSync("sudo chown -R $USER /home/agent");
3439

3540
const downloadPath: string = await tc.downloadTool(
36-
"https://github.com/step-security/agent/releases/download/v0.1.5/agent_0.1.5_linux_amd64.tar.gz"
41+
"https://github.com/step-security/agent/releases/download/v0.3.0/agent_0.3.0_linux_amd64.tar.gz"
3742
);
3843
const extractPath = await tc.extractTar(downloadPath);
3944

0 commit comments

Comments
 (0)