test vale gha pr #189
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 and suggest | |
on: | |
pull_request: | |
paths: | |
- '**/*.md' | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
vale: # Vale linting job | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Vale | |
uses: errata-ai/vale-action@v2 | |
with: | |
reporter: github-pr-reviewer | |
- name: Install jq | |
run: sudo apt-get install -y jq | |
- name: Run Vale on changed files | |
run: | | |
for file in $(git diff --name-only --cached); do | |
echo "Running Vale on $file" | |
vale --output=JSON $file > "vale_output_${file//\//_}.json" | |
vale --output=edit $file > "vale_output_${file//\//_}_edit.md" | |
done | |
echo "Vale outputs:" | |
ls -l | |
- name: Suggest changes from Vale | |
uses: parkerbxyz/suggest-changes@v1 | |
with: | |
comment: 'Please review and consider the suggested changes from Vale.' |