This is an action to run ast-grep(sg) with reviewdog.
GITHUB_TOKEN
The default is ${{ github.token }}
.
Working directory relative to the root directory.
The default is .
.
Tool name to use for reviewdog reporter.
The default is ast-grep
.
Report level for reviewdog [info,warning,error].
The default is error
.
Reporter of reviewdog command [github-check,github-pr-review,github-pr-check].
The default is github-check
.
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
Default is added
except that sarif reporter uses nofilter
.
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
.
Deprecated, use fail_level
instead.
Exit code for reviewdog when errors are found [true,false].
The default is false
.
Additional reviewdog flags.
Output directory of reviewdog result. Useful for -reporter=sarif
The default is ../reviewdog-results
.
ast-grep version.
The path to the ast-grep config file.
The default is sgconfig.yml
.
Additional ast-grep flags.
Create sgconfig.yml
and some rules in your repository by following the project setup guide.
Add a workflow to run action-ast-grep that triggered by pull request event.
name: reviewdog
on: [pull_request]
jobs:
ast-grep:
name: runner / ast-grep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-ast-grep@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Change reviewdog reporter if you need [github-check,github-pr-review,github-pr-check].
reporter: github-pr-review
# Change reporter level if you need.
# GitHub Status Check won't become failure with warning.
level: warning
# path to the sgconfig.yml
sg_config: sgconfig.yml
Reviewdog will report ast-grep scan
result.
ast-grep experimentally supports custom languages. (ref)
To use this feature with this action, build tree-sitter parsers before calling this action on your workflow.
For building tree-sitter parsers, rinx/setup-tree-sitter-parser is useful.
name: reviewdog
on: [pull_request]
jobs:
ast-grep:
name: runner / ast-grep / fennel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build tree-sitter grammar for fennel
uses: rinx/setup-tree-sitter-parser@v1
with:
# this action will place the build artifact here.
parser_dir: ./
parser_repository: alexmozaidze/tree-sitter-fennel
- name: Run ast-grep with reviewdog
uses: reviewdog/action-ast-grep@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: info
reporter: github-pr-review
You can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch). Pushing tag manually by yourself also work.
This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3. ref: https://help.github.com/en/articles/about-actions#versioning-your-action
This reviewdog action itself is integrated with reviewdog to run lints which is useful for action composition based actions.
Supported linters:
- reviewdog/action-shellcheck
- reviewdog/action-shfmt
- reviewdog/action-actionlint
- reviewdog/action-misspell
- reviewdog/action-alex
This repository uses reviewdog/action-depup to update reviewdog version.