Skip to content

Commit

Permalink
Adding a name input to allow user to name the report (#57)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
jasonjanderson and shogo82148 authored Sep 8, 2023
1 parent 4d86467 commit d144a42
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`].
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down

0 comments on commit d144a42

Please sign in to comment.