Skip to content

Commit 74712e4

Browse files
authored
chore: add style check to gh workflow (#4)
1 parent 7e835af commit 74712e4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/style.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Code Style Checks
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
8+
jobs:
9+
check-code-style:
10+
name: Check Code Style
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Get changed files
17+
id: changed-files
18+
uses: tj-actions/changed-files@v45
19+
20+
- name: Install pnpm
21+
run: npm install -g pnpm
22+
23+
- name: Install dependencies
24+
run: pnpm install
25+
26+
# Check for Markdown/MDX changes
27+
- name: Check for Markdown/MDX changes
28+
env:
29+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
30+
shell: bash
31+
run: |
32+
echo "Checking for Markdown/MDX changes..."
33+
if echo "$ALL_CHANGED_FILES" | grep -qE '\.mdx?$'; then
34+
if ! pnpm check:md; then
35+
echo "Markdown or MDX files are not properly formatted."
36+
exit 1 # Exit with a non-zero status code to indicate failure
37+
fi
38+
fi

0 commit comments

Comments
 (0)