forked from Piotr1215/upbound-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.21 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
35
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.22.0"
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.
# Ignore the DMCA since it's legal speak.
run: |
./vale --config="./utils/vale/.vale.ini" ${{ steps.changed-files.outputs.all_changed_files }} --glob='!*/dmca.md' | tee /dev/stderr | wc -l | { read wc; test $wc -eq 1; }