-
Notifications
You must be signed in to change notification settings - Fork 784
44 lines (39 loc) · 1.37 KB
/
vale.yml
File metadata and controls
44 lines (39 loc) · 1.37 KB
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
42
43
44
name: Vale Linting
# Trigger on PRs that change Markdown files
on:
pull_request:
paths:
- 'content/en/docs/**/*.md'
# Allow reading repo contents and posting PR comments
permissions:
contents: read
pull-requests: write
jobs:
vale:
# Only run on Mendix repo, not forks, and not on draft PRs
if: github.repository_owner == 'mendix' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
# Cancel old runs when new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
run: |
FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files[].path' | grep '^content/en/docs/.*\.md$' | paste -sd, -)
echo "files=$FILES" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
- name: Run Vale
if: steps.changed-files.outputs.files != ''
uses: vale-cli/vale-action@v2
with:
files: ${{ steps.changed-files.outputs.files }}
separator: ','
version: 3.14.2
fail_on_error: false
reporter: github-pr-review
vale_flags: '--minAlertLevel=error' # Only flag errors, not warnings or suggestions