-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1007 Bytes
/
style.yml
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
name: Code Style Checks
on:
push:
branches: ['master']
pull_request:
jobs:
check-code-style:
name: Check Code Style
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
# Check for Markdown/MDX changes
- name: Check for Markdown/MDX changes
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
shell: bash
run: |
echo "Checking for Markdown/MDX changes..."
if echo "$ALL_CHANGED_FILES" | grep -qE '\.mdx?$'; then
if ! pnpm check:md; then
echo "Markdown or MDX files are not properly formatted."
exit 1 # Exit with a non-zero status code to indicate failure
fi
fi