mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-08 04:47:06 +00:00
Add timeout and exception handling
This commit is contained in:
parent
99f91e6554
commit
6e2bfe8642
3 changed files with 18 additions and 7 deletions
10
dist/pre/index.js
vendored
10
dist/pre/index.js
vendored
|
|
@ -6286,11 +6286,17 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|||
return;
|
||||
}
|
||||
var correlation_id = v4();
|
||||
var env = "agent";
|
||||
var env = "agent1";
|
||||
var api_url = `https://${env}.api.stepsecurity.io/v1`;
|
||||
var web_url = "https://app.stepsecurity.io";
|
||||
let _http = new http_client.HttpClient();
|
||||
yield _http.get(`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`);
|
||||
_http.requestOptions.socketTimeout = 3 * 1000;
|
||||
try {
|
||||
yield _http.get(`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Error in connecting to ${api_url}: ${e}`);
|
||||
}
|
||||
const confg = {
|
||||
repo: process.env["GITHUB_REPOSITORY"],
|
||||
run_id: process.env["GITHUB_RUN_ID"],
|
||||
|
|
|
|||
2
dist/pre/index.js.map
vendored
2
dist/pre/index.js.map
vendored
File diff suppressed because one or more lines are too long
13
src/setup.ts
13
src/setup.ts
|
|
@ -15,14 +15,19 @@ import * as tc from "@actions/tool-cache";
|
|||
}
|
||||
|
||||
var correlation_id = uuidv4();
|
||||
var env = "agent";
|
||||
var env = "agent1";
|
||||
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`
|
||||
);
|
||||
_http.requestOptions.socketTimeout = 3 * 1000;
|
||||
try {
|
||||
await _http.get(
|
||||
`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`
|
||||
);
|
||||
} catch (e) {
|
||||
console.log(`Error in connecting to ${api_url}: ${e}`);
|
||||
}
|
||||
|
||||
const confg = {
|
||||
repo: process.env["GITHUB_REPOSITORY"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue