-
Notifications
You must be signed in to change notification settings - Fork 1.3k
61 lines (52 loc) · 1.79 KB
/
Copy pathvale_linter.yml
File metadata and controls
61 lines (52 loc) · 1.79 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
57
58
59
60
61
name: Vale
on:
pull_request:
paths:
- 'hugo/content/en/**/*'
- 'hugo/layouts/shortcodes/**/*.md'
- '!**/*.json'
permissions:
contents: read
# Stop the current running job if a new push is made to the PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
vale:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
persist-credentials: false
- name: Clone Datadog Vale
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
repository: DataDog/datadog-vale
path: datadog-vale
persist-credentials: false
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'
- run: pip install vale==3.9.1
- 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@b51e5eff3b7f56b60460c5371206e1d781ffa6ab # v1.9.0
with:
file_filter: '.md, .html'
- name: Run vale on changed files
if: steps.changed_lines.outputs.changed_files
env:
CHANGED_FILES: ${{ steps.changed_lines.outputs.changed_files }}
run: |
vale "${CHANGED_FILES}" \
--output=hugo/local/bin/py/vale/vale_template.tmpl --no-exit > vale_output.log
- name: Parse Vale output
if: steps.changed_lines.outputs.changed_files
env:
CHANGED_LINES: ${{ steps.changed_lines.outputs.changed_lines }}
run: |
python hugo/local/bin/py/vale/vale_annotations.py \
--git_data="${CHANGED_LINES}"