Skip to content

Commit

Permalink
Merge pull request #24 from step-security/feature-22
Browse files Browse the repository at this point in the history
Call API to monitor run
  • Loading branch information
varunsh-coder authored Nov 30, 2021
2 parents 917f7d5 + 40f1350 commit f4e7a3e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
7 changes: 6 additions & 1 deletion dist/pre/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pre/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "step-security-harden-runner",
"version": "0.3.0",
"version": "0.4.0",
"description": "GitHub Actions Runtime Security",
"main": "index.js",
"scripts": {
Expand All @@ -25,6 +25,7 @@
"@actions/core": "^1.5.0",
"@actions/exec": "^1.1.0",
"@actions/github": "^5.0.0",
"@actions/http-client": "^1.0.11",
"@actions/tool-cache": "^1.7.1",
"node-fetch": "^2.6.1",
"uuid": "^8.3.2"
Expand Down
9 changes: 7 additions & 2 deletions src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from "@actions/core";
import * as cp from "child_process";
import * as fs from "fs";
import * as https from "https";
import * as httpm from "@actions/http-client";
import * as path from "path";
import { v4 as uuidv4 } from "uuid";
import { printInfo } from "./common";
Expand All @@ -19,6 +19,11 @@ import * as tc from "@actions/tool-cache";
var api_url = `https://${env}.api.stepsecurity.io/v1`;
var web_url = "https://app.stepsecurity.io";

let _http = new httpm.HttpClient();
await _http.get(
`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`
);

const confg = {
repo: process.env["GITHUB_REPOSITORY"],
run_id: process.env["GITHUB_RUN_ID"],
Expand All @@ -33,7 +38,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.1.5/agent_0.1.5_linux_amd64.tar.gz"
"https://github.com/step-security/agent/releases/download/v0.3.0/agent_0.3.0_linux_amd64.tar.gz"
);
const extractPath = await tc.extractTar(downloadPath);

Expand Down

0 comments on commit f4e7a3e

Please sign in to comment.