https://github.com/reviewdog/action-stylelint
Run stylelint with reviewdog
https://github.com/reviewdog/action-stylelint
reviewdog stylelint
Last synced: 14 days ago
JSON representation
Run stylelint with reviewdog
- Host: GitHub
- URL: https://github.com/reviewdog/action-stylelint
- Owner: reviewdog
- License: mit
- Created: 2019-09-23T05:48:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T12:08:53.000Z (12 months ago)
- Last Synced: 2024-05-02T01:26:09.059Z (12 months ago)
- Topics: reviewdog, stylelint
- Language: Shell
- Homepage: https://github.com/marketplace?type=actions&query=reviewdog
- Size: 301 KB
- Stars: 45
- Watchers: 27
- Forks: 22
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Run stylelint, with reviewdog output on the PR
- fucking-awesome-actions - Run stylelint, with reviewdog output on the PR
- awesome-workflows - Run stylelint, with reviewdog output on the PR
- awesome-stylelint - reviewdog/action-stylelint - Reviewdog GitHub Action. (Analysis platforms)
README
# GitHub Action: Run stylelint with reviewdog
[](https://github.com/reviewdog/action-stylelint/actions?query=workflow%3Adepup)
[](https://github.com/reviewdog/action-stylelint/actions?query=workflow%3Arelease)
[](https://github.com/reviewdog/action-stylelint/releases)
[](https://github.com/haya14busa/action-bumpr)This action runs [stylelint](https://github.com/stylelint/stylelint) with
[reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to improve
code review experience.[](https://github.com/reviewdog/action-stylelint/pull/1)
[](https://github.com/reviewdog/action-stylelint/pull/1)## Inputs
### `fail_level`
Optional. If set to `none`, always use exit code 0 for reviewdog.
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
Possible values: [`none`, `any`, `info`, `warning`, `error`]
Default is `none`.### `fail_on_error`
Deprecated, use `fail_level` instead.
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.### `filter_mode`
Optional. Reviewdog filter mode [added, diff_context, file, nofilter]
It's the same as the `-filter-mode` flag of reviewdog.### `github_token`
**Required**. Default is `${{ github.token }}`.
### `level`
Optional. Report level for reviewdog [info,warning,error].
It's same as `-level` flag of reviewdog.### `packages`
Optional. Additional NPM packages to be installed, e.g.:
```
packages: 'stylelint-config-sass-guidelines stylelint-order'
```### `reporter`
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.### `stylelint_input`
Optional. Files or glob. Default: `**/*.css`.
It's same as `[input]` of stylelint.### `stylelint_config`
Optional. It's same as `--config` flag of stylelint.
### `workdir`
Optional. The directory from which to look for and run stylelint. Default '.'
## Example usage
You also need to install [stylelint](https://github.com/stylelint/stylelint).
```shell
# Example
$ npm install stylelint stylelint-config-recommended -D
```You can create [stylelint
config](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/configuration.md)
and this action uses that config too.### [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml)
```yml
name: reviewdog
on: [pull_request]
jobs:
stylelint:
name: runner / stylelint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: stylelint
uses: reviewdog/action-stylelint@dd2b435cc6a7c82705307a9dee740c9bbaa10411 # v1.30.2
with:
reporter: github-pr-review # Change reporter.
stylelint_input: '**/*.css'
```