From d144a42a47808e465af9ed128a8fc3482a81cef7 Mon Sep 17 00:00:00 2001 From: Jason Anderson Date: Fri, 8 Sep 2023 08:18:43 -0500 Subject: [PATCH] Adding a `name` input to allow user to name the report (#57) * Update action.yml * Update action.yml * Update script.sh * Update action.yml * Update script.sh * Update README.md * changing to tool_name --------- Co-authored-by: ICHINOSE Shogo --- README.md | 5 +++++ action.yml | 7 +++++++ script.sh | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c51cdbb..dae8ecc 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,11 @@ Optional. Report level for reviewdog [`info`,`warning`,`error`]. It's same as `-level` flag of reviewdog. The default is `error`. +### `tool_name` + +Optional. Name of the tool being used. This controls how it will show up in the GitHub UI. +The default is `tfsec`. + ### `reporter` Optional. Reporter of reviewdog command [`github-pr-check`,`github-pr-review`]. diff --git a/action.yml b/action.yml index 7967ec3..c2ee1fa 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,12 @@ inputs: description: 'Report level for reviewdog [info,warning,error]' default: 'error' required: false + tool_name: + description: | + The name for the report as it will show up in GitHub's interface. + Default is tfsec. + default: 'tfsec' + required: false reporter: description: | Reporter of reviewdog command [github-pr-check,github-pr-review]. @@ -77,6 +83,7 @@ runs: INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }} INPUT_LEVEL: ${{ inputs.level }} INPUT_REPORTER: ${{ inputs.reporter }} + INPUT_TOOL_NAME: ${{ inputs.tool_name }} INPUT_FILTER_MODE: ${{ inputs.filter_mode }} INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} INPUT_FLAGS: ${{ inputs.flags }} diff --git a/script.sh b/script.sh index a4ebe3a..e27db71 100755 --- a/script.sh +++ b/script.sh @@ -77,7 +77,7 @@ echo '::group:: Running tfsec with reviewdog 🐶 ...' } \ | jq -r -f "${GITHUB_ACTION_PATH}/to-rdjson.jq" \ | "${REVIEWDOG_PATH}/reviewdog" -f=rdjson \ - -name="tfsec" \ + -name="${INPUT_TOOL_NAME}" \ -reporter="${INPUT_REPORTER}" \ -level="${INPUT_LEVEL}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" \