Runs rubocop and reports results with reviewdog.
It's specifically designed for pull requests, and will report results only on the diff against the PR base.
If you're using something like CodeClimate, and don't like that existing external tools don't run against PRs that don't target your repo default branch, this is for you.
reporter
input is important. Thanks to reviewdog, this can either just fail checks at a given level, or additionally comment on the PR directly for each relevant failure.
Requires on: [pull_request]
- the existing marketplace actions are more globally valid. This will still check every push to a PR.
Required. Must be in form of github_token: ${{ secrets.github_token }}
'.
Optional. String to pass to rubocop
, defaults to passing nothing.
Optional. Tool name to use for the resulting reviewdog report. Useful when running multiple actions with different reviewdog reports.
Optional. Report level for reviewdog [info
, warning
, error
].
Defaults to 'error'.
Optional. Reporter of reviewdog command [github-pr-check
, github-pr-review
].
Defaults to github-pr-review
.
Optional. Defaults to passing nothing to gem install rubocop
. Let me know if you have a config string not supported outside of -v
.
Optional. String to pass to gem install
after rubocop and relevant possible dependencies install, if present.
name: Rubocop
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: rubocop
uses: Freshly/[email protected]
with:
github_token: ${{ secrets.github_token }}
rubocop_version: 0.74
reporter: github-pr-check
additional_gems: "spicerack-styleguide"
rubocop_flags: "-c rubocop/rubocop.yml --except Style/StringLiterals"
Originally forked from https://github.com/mgrachev/action-rubocop ❤️
Includes code from https://github.com/andrewmcodes/rubocop-linter-action ❤️
Logo thanks to the unrelated pursuits of https://github.com/dan1229/OctoCop ❤️