-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.11 KB
/
ci.yml
File metadata and controls
41 lines (35 loc) · 1.11 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
name: Docs CI
on:
pull_request:
branches: [main]
jobs:
validate:
name: Validate docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Check broken links
run: npx mintlify@latest broken-links
- name: Grammar lint (Vale)
uses: errata-ai/vale-action@v2
with:
reporter: github-pr-check
vale_flags: "--glob='*.mdx'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate frontmatter
run: |
missing=()
for file in $(find . -name '*.mdx' -not -path './node_modules/*'); do
head -20 "$file" | grep -q '^title:' || missing+=("$file (missing title)")
head -20 "$file" | grep -q '^description:' || missing+=("$file (missing description)")
done
if [ ${#missing[@]} -gt 0 ]; then
echo "Files with missing frontmatter:"
printf ' %s\n' "${missing[@]}"
exit 1
fi
echo "All MDX files have required frontmatter."