-
Notifications
You must be signed in to change notification settings - Fork 944
41 lines (33 loc) · 1.12 KB
/
vale.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Vale Lint
on:
pull_request:
paths:
- '**/*.md'
jobs:
vale:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history so we can access all commits
- name: Install jq
run: sudo apt-get install -y jq
- name: Get changed files
id: changed-files
run: |
BASE_SHA=$(git merge-base origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
CHANGED_FILES=$(git diff --name-only $BASE_SHA ${{ github.sha }} -- '*.md')
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
echo "::set-output name=files::$(cat changed_files.json)"
- name: Print Changed Files
run: echo $CHANGED_FILES
- name: Install Vale
uses: errata-ai/vale-action@v2
- name: Run Vale on Changed Files
run: |
for file in $CHANGED_FILES; do
vale --output=JSON $file | reviewdog -f=vale -name="Vale" -reporter=github-pr-review -level=warning -filter-mode=nofilter
done
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.files }}