mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-09 10:47:08 +00:00
feat: add skip-harden-runner input to conditionally skip execution
This commit is contained in:
parent
df199fb7be
commit
1dc7c17646
9 changed files with 35 additions and 2 deletions
|
|
@ -32,6 +32,10 @@ inputs:
|
|||
description: "Policy name to be used from the policy store"
|
||||
required: false
|
||||
default: ""
|
||||
skip-harden-runner:
|
||||
description: "Set to 'true' to skip harden-runner. Use with expressions to conditionally skip based on custom properties or other conditions."
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
branding:
|
||||
icon: "check-square"
|
||||
|
|
|
|||
4
dist/index.js
vendored
4
dist/index.js
vendored
|
|
@ -27803,6 +27803,10 @@ 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 (lib_core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
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
5
dist/post/index.js
vendored
5
dist/post/index.js
vendored
|
|
@ -27850,8 +27850,13 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
|
|||
|
||||
|
||||
|
||||
|
||||
(() => cleanup_awaiter(void 0, void 0, void 0, function* () {
|
||||
console.log("[harden-runner] post-step");
|
||||
if (lib_core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
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
4
dist/pre/index.js
vendored
4
dist/pre/index.js
vendored
|
|
@ -85612,6 +85612,10 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
|
|||
var _a, _b;
|
||||
try {
|
||||
console.log("[harden-runner] pre-step");
|
||||
if (lib_core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
if (process.platform !== "linux") {
|
||||
console.log(UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import * as fs from "fs";
|
||||
import * as cp from "child_process";
|
||||
import * as core from "@actions/core";
|
||||
import * as common from "./common";
|
||||
import isDocker from "is-docker";
|
||||
import { isARCRunner } from "./arc-runner";
|
||||
|
|
@ -7,6 +8,11 @@ import { isGithubHosted } from "./tls-inspect";
|
|||
(async () => {
|
||||
console.log("[harden-runner] post-step");
|
||||
|
||||
if (core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ import { isGithubHosted } from "./tls-inspect";
|
|||
(async () => {
|
||||
console.log("[harden-runner] main-step");
|
||||
|
||||
if (core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ interface MonitorResponse {
|
|||
try {
|
||||
console.log("[harden-runner] pre-step");
|
||||
|
||||
if (core.getBooleanInput("skip-harden-runner")) {
|
||||
console.log("Skipping harden-runner as skip-harden-runner is set to true");
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.platform !== "linux") {
|
||||
console.log(common.UBUNTU_MESSAGE);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue