-
Notifications
You must be signed in to change notification settings - Fork 115
34 lines (28 loc) · 1.15 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
name: Validate content with Vale
on:
pull_request:
paths:
- 'content/**'
# Allows manual workflow run (must in default branch to work)
workflow_dispatch:
jobs:
lint-content:
runs-on: ubuntu-latest
steps:
- name: Checkout the docs repo
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
with:
files: content/**
- name: Install Vale
env:
VALE_VERSION: "2.28.2"
run: wget https://github.com/errata-ai/vale/releases/download/v${{env.VALE_VERSION}}/vale_${{env.VALE_VERSION}}_Linux_64-bit.tar.gz && tar -xvzf vale_${{env.VALE_VERSION}}_Linux_64-bit.tar.gz
- name: Run Vale
if: steps.changed-files.outputs.any_changed == 'true'
# Run vale and display the output. Fail if the output is greater than 1 line.
# Vale uses a 0 return code for warnings and suggestions. These should be considered failures.
run: |
./vale --config="./utils/vale/.vale.ini" ${{ steps.changed-files.outputs.all_changed_files }} | tee /dev/stderr | wc -l | { read wc; test $wc -eq 1; }