Run Detekt with reviewdog
  • Shell 60.9%
  • Dockerfile 39.1%
Find a file
Al Sutton 0d37563ef2
Some checks failed
Docker Image CI / build (push) Has been cancelled
Merge tag 'v1.23.7' into sa-main
2025-01-02 09:43:33 +00:00
.github/workflows Implement action (#1) 2020-05-28 19:52:37 +03:00
assets Fill Readme (#2) 2020-05-29 20:21:43 +03:00
.gitignore Implement action (#1) 2020-05-28 19:52:37 +03:00
action.yml Fail the job if the detekt run fails 2024-08-23 11:16:53 +01:00
Dockerfile Merge tag 'v1.23.7' into sa-main 2025-01-02 09:43:33 +00:00
entrypoint.sh Fail the job if the detekt run fails 2024-08-23 11:16:53 +01:00
LICENSE Initial commit 2020-05-28 19:06:54 +03:00
README.md parent c41d319c91 (#71) 2024-12-20 21:50:55 +02:00

Github Action for running detekt with reviewdog

GitHub release (latest by date)

This action allows running detekt with reviewdog on pull requests

Examples

github-pr-check - used by default

reviewdog_reporter: github-pr-check
github-pr-check reporter reports results to GitHub Checks

Example comment made by the action with github-pr-check

github-pr-review

reviewdog_reporter: github-pr-review
github-pr-review reporter reports results to GitHub PullRequest review comments.

Example comment made by the action with github-pr-review

Inputs

This action has several inputs you may be interested in:

github_token

Required. Must be in form of github_token: ${{ secrets.github_token }}.

reviewdog_level

Optional. Report level for reviewdog's github-pr-check reporter [info,warning,error].
It's same as -level flag of reviewdog. The default is error.

reviewdog_filter

Optional. Filter mode for reviewdog. [added ,diff_context,file,nofilter]
It's same as -filter-mode flag of reviewdog.
The default is added.

Read more

reviewdog_reporter

Optional. Reporter for reviewdog. [github-pr-check,github-pr-review]
The default is github-pr-check.

Read more

detekt_config

Optional. Path to the config file for detekt.
The default is default-detekt-config.yml

Read more

detekt_excludes

Optional. Globing patterns describing paths to exclude from the analysis.
The default is **/build/**,**/.idea/**

Read more

fail_on_error

Optional. Fails the current check if any error was found [true/false]
The default value is true.

detekt_plugins

Optional. Additional plugins for detekt.
Should be defined with comma separation detekt_plugins: 'path/1.jar,path/2.jar'
The default value is empty.

Read more

detekt_baseline

Optional. Provides baseline.xml file to detekt.
The default value is empty.

Read more

detekt_parallel

Optional. Executes detekt in parallel.
The default value is empty. To enable declare detekt_parallel: true

Read more

detekt_build_upon_default_config

Optional. Preconfigures detekt with a bunch of rules and some opinionated defaults for you.
Allows additional provided configurations to override the defaults.
To enable declare detekt_build_upon_default_config: true

Read more

detekt_all_rules

Optional. Activates all available (even unstable) rules.
The default value is empty. To enable declare detekt_all_rules: true

Read more

detekt_input

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

Read more

Usage

Following example runs detekt with

name: reviewdog
on: [ pull_request ]

jobs:
  detekt:
    name: Check Code Quality
    runs-on: ubuntu-latest

    steps:
      - name: Clone repo
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
          ref: ${{ github.head_ref }}

      - name: detekt
        uses: alaegin/Detekt-Action@v1.23.7
        with:
          github_token: ${{ secrets.github_token }}
          detekt_config: detekt-config.yml # Change config path

License

MIT

Inspiration