From 7c229406fd8d9dc359908b8440d01347c2bb7856 Mon Sep 17 00:00:00 2001 From: srvmsr Date: Sun, 30 Oct 2022 11:26:39 +0100 Subject: [PATCH] Added tmpPath variable for linux agents --- marketplace.md | 7 +++++++ tfsec-task/index.ts | 2 +- tfsec-task/task.json | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/marketplace.md b/marketplace.md index 093742c..57a3876 100644 --- a/marketplace.md +++ b/marketplace.md @@ -51,6 +51,13 @@ Run a specific version of tfsec. inputs: dir: ./terraform ``` +### Specify the directory to download tfsec binnary and store resuls files on Linux agents, Default is /tmp/ + +```yaml +- task: tfsec@1 + inputs: + tmpPath: /tmp/ +``` ### Skip publishing test results diff --git a/tfsec-task/index.ts b/tfsec-task/index.ts index f7cf0fe..c9d7312 100644 --- a/tfsec-task/index.ts +++ b/tfsec-task/index.ts @@ -8,7 +8,7 @@ async function run() { try { console.log("Finding correct tfsec version...") let url = await getArtifactURL() - let tmpPath = "/tmp/" + let tmpPath = task.getInput("tmpPath", true) let bin = "tfsec" let chmodRequired = true; if (os.platform() == "win32") { diff --git a/tfsec-task/task.json b/tfsec-task/task.json index 905a58d..a7bc87b 100644 --- a/tfsec-task/task.json +++ b/tfsec-task/task.json @@ -49,6 +49,14 @@ "defaultValue": "", "required": false, "helpMarkDown": "The specified directory will be scanned for problems" + }, + { + "name": "tmpPath", + "type": "string", + "label": "The directory to download tfsec and store results files on Linux agents", + "defaultValue": "/tmp/", + "required": false, + "helpMarkDown": "The specified directory will used to download tfsec binary and store results files on Linux agents" } ], "execution": {