From 6479fb644eaf6a5a51d3c1f36794ee39c9be3533 Mon Sep 17 00:00:00 2001 From: Ayala Dviri Date: Tue, 21 May 2024 21:53:32 +0300 Subject: [PATCH] CICD-2768: support debug flag --- README.md | 2 ++ action.yaml | 7 +++++++ entrypoint.sh | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 3def0a1..0d9b318 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,8 @@ jobs: | max_file_size | 3 | Maximum file size to be scanned in MB. Bigger files will be skipped | Integer | No | 5 | | terraform_vars_path | /terraform-vars-path/terraform-vars.tfvars | Path where terraform variables are present | String | No | N/A | | display_name | custom-display-name | Scan log display name (on Orca platform) | String | No | N/A | +| debug | true | Debug mode | Boolean | No | false | +| log_path | results/ | The directory path to specify where the logs should be written to on debug mode. | String | No | working directory | ## Annotations After scanning, the action will add the results as annotations in a pull request: diff --git a/action.yaml b/action.yaml index 98bed09..30e838e 100644 --- a/action.yaml +++ b/action.yaml @@ -107,6 +107,13 @@ inputs: display_name: description: "Scan log display name (on Orca platform)" required: false + debug: + description: "Debug mode" + required: false + default: "false" + log_path: + description: "The directory path to specify where the logs should be written to on debug mode. Default to the current working directory" + required: false outputs: exit_code: diff --git a/entrypoint.sh b/entrypoint.sh index 0d095d8..2e7106d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -49,6 +49,12 @@ function set_global_flags() { if [ "${INPUT_DISPLAY_NAME}" ]; then GLOBAL_FLAGS+=(--display-name "${INPUT_DISPLAY_NAME}") fi + if [ "${INPUT_DEBUG}" == "true" ]; then + GLOBAL_FLAGS+=(--debug) + fi + if [ "${INPUT_LOG_PATH}" ]; then + GLOBAL_FLAGS+=(--log-path "${INPUT_LOG_PATH}") + fi } # Json format must be reported and be stored in a file for github annotations