-
Notifications
You must be signed in to change notification settings - Fork 786
56 lines (51 loc) · 1.92 KB
/
vale.yml
File metadata and controls
56 lines (51 loc) · 1.92 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
45
46
47
48
49
50
51
52
53
54
55
56
name: Vale Linting
# Trigger on PRs that change Markdown files
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'content/en/docs/**/*.md'
# Allow reading repo contents and posting PR comments
# Note: Fork PRs from org members run automatically but get read-only tokens,
# so reviewdog falls back to check annotations instead of review comments.
# External contributors require workflow approval per repo settings.
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
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# 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@v6
with:
sparse-checkout: |
.vale.ini
.vale
content/en/docs
sparse-checkout-cone-mode: false
- 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 # Uses filter_mode=added (default): only comment on modified lines
vale_flags: '--minAlertLevel=error' # Only flag errors, not warnings or suggestions