Skip to content

Commit

Permalink
Add support for detekt_input argument (#50)
Browse files Browse the repository at this point in the history
* Add support for detekt input

* Update version

---------

Co-authored-by: Andrei Litvin <[email protected]>
Co-authored-by: Alexey Egin <[email protected]>
  • Loading branch information
3 people committed Aug 10, 2023
1 parent d23a4e9 commit cda62cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ To enable declare `detekt_all_rules: true`

[Read more](https://detekt.github.io/detekt/cli.html)

### `detekt_input`

Optional. Specify explicit inputs to detect-cli.
Inputs provided as a comma-separated string.

[Read more](https://detekt.github.io/detekt/cli.html)

## Usage

Following example runs detekt with
Expand All @@ -132,7 +139,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: detekt
uses: alaegin/[email protected]
uses: alaegin/[email protected].1
with:
github_token: ${{ secrets.github_token }}
detekt_config: detekt-config.yml # Change config path
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ inputs:
detekt_all_rules:
description: 'Activates all available (even unstable) rules.'
required: false
detekt_input:
description: |
'Specific inputs for detekt (the --input argument for detekt-cli)'
Example: 'path/to/dir1,path/to/dir2'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -70,6 +75,7 @@ runs:
- ${{ inputs.detekt_parallel }}
- ${{ inputs.detekt_build_upon_default_config }}
- ${{ inputs.detekt_all_rules }}
- ${{ inputs.detekt_input }}
branding:
icon: 'check-square'
color: 'orange'
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ if [ -n "$DETEKT_ALL_RULES" ]; then
detekt_command+="--all-rules "
fi

if [ -n "$DETEKT_INPUT" ]; then
detekt_command+="--input ${DETEKT_INPUT} "
fi

echo "$detekt_command"
eval "$detekt_command"

Expand Down

0 comments on commit cda62cc

Please sign in to comment.