GitHub Action
Run stylelint with reviewdog
This action runs stylelint with reviewdog on pull requests to improve code review experience.
Whether reviewdog should fail when errors are found. [true,false]
This is useful for failing CI builds in addition to adding comments when errors are found.
It's the same as the -fail-on-error
flag of reviewdog.
Optional. Reviewdog filter mode [added, diff_context, file, nofilter]
It's the same as the -filter-mode
flag of reviewdog.
Required. Default is ${{ github.token }}
.
Optional. Report level for reviewdog [info,warning,error].
It's same as -level
flag of reviewdog.
Optional. Additional NPM packages to be installed, e.g.:
packages: 'stylelint-config-sass-guidelines stylelint-order'
Reporter of reviewdog command [github-pr-check,github-pr-review,github-check]. Default is github-pr-check. github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
Optional. Files or glob. Default: **/*.css
.
It's same as [input]
of stylelint.
Optional. It's same as --config
flag of stylelint.
Optional. The directory from which to look for and run stylelint. Default '.'
You also need to install stylelint.
# Example
$ npm install stylelint stylelint-config-recommended -D
You can create stylelint config and this action uses that config too.
name: reviewdog
on: [pull_request]
jobs:
stylelint:
name: runner / stylelint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: stylelint
uses: reviewdog/action-stylelint@v1
with:
reporter: github-pr-review # Change reporter.
stylelint_input: '**/*.css'