visit
$ dotenv-linter | reviewdog -efm="%f:%l %m
"1. As an annotation in the code (
github-pr-check
)2. And in the form of comments to pull requests (
github-pr-review
)The first 4 actions (action-rubocop, action-brakeman, action-reek, and action-fasterer) allow you to run popular linters from the Ruby community: rubocop, brakeman, reek, and fasterer. To connect these actions to your project, you just need to create a
.github/workflows/linters.yml
file with the following content:# .github/workflows/linters.yml
name: linters
on: [pull_request]
jobs:
linters:
name: runner / linters
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: rubocop
uses: reviewdog/action-rubocop@v1
with:
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
github_token: ${{ secrets.github_token }}
- name: brakeman
uses: reviewdog/action-brakeman@v1
with:
brakeman_version: gemfile
github_token: ${{ secrets.github_token }}
- name: reek
uses: reviewdog/action-reek@v1
with:
reek_version: gemfile
github_token: ${{ secrets.github_token }}
- name: fasterer
uses: vk26/action-fasterer@v1
with:
github_token: ${{ secrets.github_token }}
gemfile
- the version from Gemfile.lock will be installed.Action-rubocop also provides the ability to install additional extensions. The following extensions are installed by default:
rubocop-rails, rubocop-performance, rubocop-rspec, rubocop-i18n, rubocop-rake
. But this can be overridden using the rubocop_extensions
attribute.The next action, action-hadolint, looks for all
Dockerfile
in the project and checks them using the hadolint linter. Usage example:# .github/workflows/hadolint.yml
name: hadolint
on: [pull_request]
jobs:
hadolint:
name: runner / hadolint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: hadolint
uses: reviewdog/action-hadolint@v1
with:
github_token: ${{ secrets.github_token }}
hadolint_ignore: DL3008
And last but not least, is action-dotenv-linter. It allows you to easily and simply check all
.env
files on the project. Usage example:# .github/workflows/dotenv_linter.yml
name: dotenv-linter
on: [pull_request]
jobs:
dotenv-linter:
name: runner / dotenv-linter
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: dotenv-linter
uses: dotenv-linter/action-dotenv-linter@v2
with:
github_token: ${{ secrets.github_token }}
dotenv_linter_flags: --skip UnorderedKey
Previously published at The author of the story is the Chief Editor at .