feat: add skip-harden-runner input to conditionally skip execution

This commit is contained in:
Varun Sharma 2025-11-30 20:53:32 -08:00
commit 1dc7c17646
9 changed files with 35 additions and 2 deletions

View file

@ -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
View file

@ -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

File diff suppressed because one or more lines are too long

5
dist/post/index.js vendored
View file

@ -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;

File diff suppressed because one or more lines are too long

4
dist/pre/index.js vendored
View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;