mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-05 22:47:05 +00:00
logging step
This commit is contained in:
parent
0fe20c9a7d
commit
727d06a16d
9 changed files with 76 additions and 39 deletions
1
dist/index.js
vendored
1
dist/index.js
vendored
|
|
@ -3028,6 +3028,7 @@ var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
|||
|
||||
|
||||
(() => src_awaiter(void 0, void 0, void 0, function* () {
|
||||
console.log("[harden-runner] main-step");
|
||||
if (process.platform !== "linux") {
|
||||
console.log(UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/post/index.js
vendored
1
dist/post/index.js
vendored
|
|
@ -3076,6 +3076,7 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
|
|||
|
||||
|
||||
(() => cleanup_awaiter(void 0, void 0, void 0, function* () {
|
||||
console.log("[harden-runner] post-step");
|
||||
if (process.platform !== "linux") {
|
||||
console.log(UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
101
dist/pre/index.js
vendored
101
dist/pre/index.js
vendored
|
|
@ -20024,11 +20024,12 @@ exports.setSpanContext = setSpanContext;
|
|||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
var abortController = __nccwpck_require__(2557);
|
||||
var crypto = __nccwpck_require__(6417);
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* Creates an abortable promise.
|
||||
* @param buildPromise - A function that takes the resolve and reject functions as parameters.
|
||||
|
|
@ -20069,7 +20070,6 @@ function createAbortablePromise(buildPromise, options) {
|
|||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
const StandardAbortMessage = "The delay was aborted.";
|
||||
/**
|
||||
* A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.
|
||||
|
|
@ -20089,27 +20089,6 @@ function delay(timeInMs, options) {
|
|||
});
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* promise.race() wrapper that aborts rest of promises as soon as the first promise settles.
|
||||
*/
|
||||
async function cancelablePromiseRace(abortablePromiseBuilders, options) {
|
||||
var _a, _b;
|
||||
const aborter = new abortController.AbortController();
|
||||
function abortHandler() {
|
||||
aborter.abort();
|
||||
}
|
||||
(_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler);
|
||||
try {
|
||||
return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal })));
|
||||
}
|
||||
finally {
|
||||
aborter.abort();
|
||||
(_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler);
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
|
|
@ -20146,7 +20125,6 @@ function isObject(input) {
|
|||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* Typeguard for an error object shape (has name and message)
|
||||
* @param e - Something caught by a catch clause.
|
||||
|
|
@ -20187,7 +20165,6 @@ function getErrorMessage(e) {
|
|||
}
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
/**
|
||||
* Generates a SHA-256 HMAC signature.
|
||||
* @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash.
|
||||
|
|
@ -20312,20 +20289,16 @@ const isWebWorker = typeof self === "object" &&
|
|||
(((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
|
||||
((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
|
||||
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
|
||||
/**
|
||||
* A constant that indicates whether the environment the code is running is Node.JS.
|
||||
*/
|
||||
const isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node);
|
||||
/**
|
||||
* A constant that indicates whether the environment the code is running is Deno.
|
||||
*/
|
||||
const isDeno = typeof Deno !== "undefined" &&
|
||||
typeof Deno.version !== "undefined" &&
|
||||
typeof Deno.version.deno !== "undefined";
|
||||
/**
|
||||
* A constant that indicates whether the environment the code is running is Node.JS.
|
||||
*/
|
||||
const isNode = typeof process !== "undefined" &&
|
||||
Boolean(process.version) &&
|
||||
Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
|
||||
// Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
||||
!isDeno;
|
||||
/**
|
||||
* A constant that indicates whether the environment the code is running is Bun.sh.
|
||||
*/
|
||||
|
|
@ -20345,7 +20318,14 @@ const isReactNative = typeof navigator !== "undefined" && (navigator === null ||
|
|||
* @returns a string of the encoded string
|
||||
*/
|
||||
function uint8ArrayToString(bytes, format) {
|
||||
return Buffer.from(bytes).toString(format);
|
||||
switch (format) {
|
||||
case "utf-8":
|
||||
return uint8ArrayToUtf8String(bytes);
|
||||
case "base64":
|
||||
return uint8ArrayToBase64(bytes);
|
||||
case "base64url":
|
||||
return uint8ArrayToBase64Url(bytes);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The helper that transforms string to specific character encoded bytes array.
|
||||
|
|
@ -20354,10 +20334,58 @@ function uint8ArrayToString(bytes, format) {
|
|||
* @returns a uint8array
|
||||
*/
|
||||
function stringToUint8Array(value, format) {
|
||||
return Buffer.from(value, format);
|
||||
switch (format) {
|
||||
case "utf-8":
|
||||
return utf8StringToUint8Array(value);
|
||||
case "base64":
|
||||
return base64ToUint8Array(value);
|
||||
case "base64url":
|
||||
return base64UrlToUint8Array(value);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Decodes a Uint8Array into a Base64 string.
|
||||
* @internal
|
||||
*/
|
||||
function uint8ArrayToBase64(bytes) {
|
||||
return Buffer.from(bytes).toString("base64");
|
||||
}
|
||||
/**
|
||||
* Decodes a Uint8Array into a Base64Url string.
|
||||
* @internal
|
||||
*/
|
||||
function uint8ArrayToBase64Url(bytes) {
|
||||
return Buffer.from(bytes).toString("base64url");
|
||||
}
|
||||
/**
|
||||
* Decodes a Uint8Array into a javascript string.
|
||||
* @internal
|
||||
*/
|
||||
function uint8ArrayToUtf8String(bytes) {
|
||||
return Buffer.from(bytes).toString("utf-8");
|
||||
}
|
||||
/**
|
||||
* Encodes a JavaScript string into a Uint8Array.
|
||||
* @internal
|
||||
*/
|
||||
function utf8StringToUint8Array(value) {
|
||||
return Buffer.from(value);
|
||||
}
|
||||
/**
|
||||
* Encodes a Base64 string into a Uint8Array.
|
||||
* @internal
|
||||
*/
|
||||
function base64ToUint8Array(value) {
|
||||
return Buffer.from(value, "base64");
|
||||
}
|
||||
/**
|
||||
* Encodes a Base64Url string into a Uint8Array.
|
||||
* @internal
|
||||
*/
|
||||
function base64UrlToUint8Array(value) {
|
||||
return Buffer.from(value, "base64url");
|
||||
}
|
||||
|
||||
exports.cancelablePromiseRace = cancelablePromiseRace;
|
||||
exports.computeSha256Hash = computeSha256Hash;
|
||||
exports.computeSha256Hmac = computeSha256Hmac;
|
||||
exports.createAbortablePromise = createAbortablePromise;
|
||||
|
|
@ -71662,6 +71690,7 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
|
|||
(() => setup_awaiter(void 0, void 0, void 0, function* () {
|
||||
var _a, _b;
|
||||
try {
|
||||
console.log("[harden-runner] pre-step");
|
||||
if (process.platform !== "linux") {
|
||||
console.log(UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
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
|
|
@ -5,6 +5,8 @@ import isDocker from "is-docker";
|
|||
import { arcCleanUp, isArcRunner, removeStepPolicyFiles } from "./arc-runner";
|
||||
|
||||
(async () => {
|
||||
console.log("[harden-runner] post-step");
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import isDocker from "is-docker";
|
|||
import { STEPSECURITY_WEB_URL } from "./configs";
|
||||
|
||||
(async () => {
|
||||
console.log("[harden-runner] main-step");
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ interface MonitorResponse {
|
|||
|
||||
(async () => {
|
||||
try {
|
||||
console.log("[harden-runner] pre-step");
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue