Skip to content

Commit 642387b

Browse files
KianNHkodster28
andauthored
[Docs Site] Lint YAML files with Vale (cloudflare#12818)
* [Docs Site] Lint YAML files with Vale * Test md * Fix non-standard quotes and remove md example --------- Co-authored-by: Kody Jackson <[email protected]>
1 parent d31ed36 commit 642387b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/vale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
run: |
2424
# get file names and structure as JSON
25-
files=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files -q '.[] | select(.status != "removed" and (.filename | endswith(".md"))) | .filename')
25+
files=$(gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files -q '.[] | select(.status != "removed") | .filename | select(test("(.yaml|yml|md)$"))')
2626
filesArray="[$(echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/ /", "/g' | tr '\n' , | sed 's/,$//')]"
2727
echo "CHANGED_FILES=$filesArray" >> "$GITHUB_ENV"
2828

.vale.ini

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
StylesPath = .github/styles
22
MinAlertLevel = suggestion
33

4+
[formats]
5+
yml = yaml
6+
47
[*.md]
58
BasedOnStyles = cloudflare
6-
BlockIgnores = (?s) *({{< ?code-block [^>]* >}}.*?{{< ?/ ?code-block >}})
9+
BlockIgnores = (?s) *({{< ?code-block [^>]* >}}.*?{{< ?/ ?code-block >}})
10+
11+
[*.yaml]
12+
BasedOnStyles = cloudflare

data/time-services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ product:
88

99
meta:
1010
title: Cloudflare Time Services docs
11-
description: 'Cloudflares suite of time services: NTP, NTS, and Roughtime.'
11+
description: "Cloudflare's suite of time services: NTP, NTS, and Roughtime."
1212
author: '@cloudflare'
1313

1414
externals:

0 commit comments

Comments
 (0)