Docs/vale lint ci centralized #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint Documentation | |
on: | |
[pull_request] | |
# paths: | |
# - 'docs/**' # Adjust this pattern as needed | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Fetch docs-styles repository | |
run: | | |
git clone https://github.com/ivegabr/docs-styles.git ./docs-styles | |
- name: Install Vale via errata-ai/vale-action | |
uses: errata-ai/vale-action@v2 | |
- name: Install reviewdog | |
uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
- name: Run Vale and report via reviewdog | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Run Vale with your central configuration and output in JSON format. | |
vale --output=JSON --config=./docs-styles/.vale.ini docs/ > vale-report.json | |
# Pipe the JSON output from Vale into reviewdog, which will post inline comments. | |
reviewdog -f=rdjson -name=vale -reporter=github-pr-review -level=error < vale-report.json |