Skip to content

Commit a2e5179

Browse files
committed
Add PR check workflow
1 parent e2f88f1 commit a2e5179

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/pr-checks.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Pull Request Checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint-markdown:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the code
13+
uses: actions/checkout@v3
14+
15+
- name: Install Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '16'
19+
20+
- name: Install markdownlint
21+
run: |
22+
npm install -g markdownlint-cli
23+
24+
- name: Run markdown lint
25+
run: |
26+
markdownlint "**/*.md"
27+
28+
spell-check:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check out the code
32+
uses: actions/checkout@v3
33+
34+
- name: Install cspell
35+
run: |
36+
npm install -g cspell
37+
38+
- name: Run spell check
39+
run: |
40+
cspell "**/*.md" || echo "Some spelling errors detected. Review the log for details."
41+
42+
validate-yaml-front-matter:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Check out the code
46+
uses: actions/checkout@v3
47+
48+
- name: Validate front matter
49+
run: |
50+
for file in _posts/*.md; do
51+
if ! grep -q "title:" "$file" || ! grep -q "date:" "$file"; then
52+
echo "Error: Missing required front matter fields in $file"
53+
exit 1
54+
fi
55+
done

0 commit comments

Comments
 (0)