Skip to content

Commit db8c153

Browse files
committed
ci: upgrade checkout action and add front matter validation
Upgrade actions/checkout from v3 to v4. Add a validation step that checks all feature Markdown files have proper YAML front matter, catching malformed contributions before deploy. Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent ed90aa5 commit db8c153

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/gh-pages.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: true
1919
fetch-depth: 0
@@ -27,6 +27,20 @@ jobs:
2727
- name: Build
2828
run: cd website && hugo --minify -d ../public
2929

30+
- name: Validate front matter
31+
run: |
32+
errors=0
33+
for f in $(find website/content -name '*.md' ! -name '_index.md'); do
34+
if ! head -1 "$f" | grep -q '^---$'; then
35+
echo "ERROR: $f missing front matter"
36+
errors=$((errors + 1))
37+
fi
38+
done
39+
if [ "$errors" -gt 0 ]; then
40+
echo "$errors file(s) with missing front matter"
41+
exit 1
42+
fi
43+
3044
- name: Deploy
3145
uses: peaceiris/actions-gh-pages@v3
3246
if: ${{ github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)