Skip to content

Commit 1dc7c17

Browse files
committed
feat: add skip-harden-runner input to conditionally skip execution
1 parent df199fb commit 1dc7c17

File tree

9 files changed

+35
-2
lines changed

9 files changed

+35
-2
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ inputs:
3232
description: "Policy name to be used from the policy store"
3333
required: false
3434
default: ""
35+
skip-harden-runner:
36+
description: "Set to 'true' to skip harden-runner. Use with expressions to conditionally skip based on custom properties or other conditions."
37+
required: false
38+
default: "false"
3539

3640
branding:
3741
icon: "check-square"

dist/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27803,6 +27803,10 @@ var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argu
2780327803

2780427804
(() => src_awaiter(void 0, void 0, void 0, function* () {
2780527805
console.log("[harden-runner] main-step");
27806+
if (lib_core.getBooleanInput("skip-harden-runner")) {
27807+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
27808+
return;
27809+
}
2780627810
if (process.platform !== "linux") {
2780727811
console.log(UBUNTU_MESSAGE);
2780827812
return;

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27850,8 +27850,13 @@ var cleanup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
2785027850

2785127851

2785227852

27853+
2785327854
(() => cleanup_awaiter(void 0, void 0, void 0, function* () {
2785427855
console.log("[harden-runner] post-step");
27856+
if (lib_core.getBooleanInput("skip-harden-runner")) {
27857+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
27858+
return;
27859+
}
2785527860
if (process.platform !== "linux") {
2785627861
console.log(UBUNTU_MESSAGE);
2785727862
return;

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pre/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85612,6 +85612,10 @@ var setup_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
8561285612
var _a, _b;
8561385613
try {
8561485614
console.log("[harden-runner] pre-step");
85615+
if (lib_core.getBooleanInput("skip-harden-runner")) {
85616+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
85617+
return;
85618+
}
8561585619
if (process.platform !== "linux") {
8561685620
console.log(UBUNTU_MESSAGE);
8561785621
return;

src/cleanup.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import * as fs from "fs";
22
import * as cp from "child_process";
3+
import * as core from "@actions/core";
34
import * as common from "./common";
45
import isDocker from "is-docker";
56
import { isARCRunner } from "./arc-runner";
67
import { isGithubHosted } from "./tls-inspect";
78
(async () => {
89
console.log("[harden-runner] post-step");
910

11+
if (core.getBooleanInput("skip-harden-runner")) {
12+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
13+
return;
14+
}
15+
1016
if (process.platform !== "linux") {
1117
console.log(common.UBUNTU_MESSAGE);
1218
return;

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import { isGithubHosted } from "./tls-inspect";
66
(async () => {
77
console.log("[harden-runner] main-step");
88

9+
if (core.getBooleanInput("skip-harden-runner")) {
10+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
11+
return;
12+
}
13+
914
if (process.platform !== "linux") {
1015
console.log(common.UBUNTU_MESSAGE);
1116
return;

src/setup.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ interface MonitorResponse {
3939
try {
4040
console.log("[harden-runner] pre-step");
4141

42+
if (core.getBooleanInput("skip-harden-runner")) {
43+
console.log("Skipping harden-runner as skip-harden-runner is set to true");
44+
return;
45+
}
46+
4247
if (process.platform !== "linux") {
4348
console.log(common.UBUNTU_MESSAGE);
4449
return;

0 commit comments

Comments
 (0)