-
Notifications
You must be signed in to change notification settings - Fork 1.1k
47 lines (40 loc) · 1.21 KB
/
vale_linter.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
42
43
44
45
46
47
name: Vale
on:
pull_request:
paths:
- 'content/en/**/*'
- 'layouts/shortcodes/**/*.md'
jobs:
vale:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Clone Datadog Vale
uses: actions/checkout@v4
with:
repository: DataDog/datadog-vale
path: datadog-vale
- uses: actions/[email protected]
with:
python-version: '3.11'
- run: pip install vale
- name: Edit StylesPath in Vale config file
run: sed -i 's/\.\.\/datadog-vale\/styles/datadog-vale\/styles/' .vale.ini
- name: Find changed lines
id: changed_lines
uses: hestonhoffman/changed-lines@v1
with:
file_filter: '.md, .html'
- name: Run vale on changed files
env:
CHANGED_FILES: ${{ steps.changed_lines.outputs.changed_files }}
run: |
vale "${CHANGED_FILES}" \
--output=local/bin/py/vale/vale_template.tmpl --no-exit > vale_output.log
- name: Parse Vale output
env:
CHANGED_LINES: ${{ steps.changed_lines.outputs.changed_lines }}
run: |
python local/bin/py/vale/vale_annotations.py \
--git_data="${CHANGED_LINES}"