Skip to content

Commit abdaa72

Browse files
authored
Attempt to fix validate-document.yml (#550)
1 parent c5c8a59 commit abdaa72

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

.github/workflows/validate-document.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
pull_request:
55
branches:
66
- master
7-
paths:
8-
- "website/**/.mdx"
7+
paths:
8+
- "website/**/*.mdx"
99

1010
workflow_dispatch:
1111
inputs:
@@ -19,48 +19,48 @@ on:
1919
- warning
2020
- debug
2121

22-
jobs:
23-
validate_document:
24-
runs-on: ubuntu-latest
22+
jobs:
23+
validate_document:
24+
runs-on: ubuntu-latest
2525

26-
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
29-
with:
30-
fetch-depth: 0
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
3131

32-
- name: Set up Node.js
33-
uses: actions/setup-node@v4
34-
with:
35-
node-version: "22"
36-
cache: "npm"
37-
cache-dependency-path: website/package-lock.json
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: "22"
36+
cache: "npm"
37+
cache-dependency-path: website/package-lock.json
3838

39-
- name: Install dependencies
40-
run: npm install ignore sharp
41-
42-
- name: Run validate document script
43-
run: |
44-
FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep '\.mdx$')
45-
echo "Changed document files: $FILES"
46-
if [ -z "$FILES" ]; then
47-
echo "No document files changed."
48-
exit 0
49-
fi
50-
51-
# Filter out files that no longer exist
52-
EXISTING_FILES=""
53-
for FILE in $FILES; do
54-
if [ -f "$FILE" ]; then
55-
EXISTING_FILES="$EXISTING_FILES $FILE"
56-
else
57-
echo "Warning: File '$FILE' no longer exists and will be skipped."
58-
fi
59-
done
39+
- name: Install dependencies
40+
run: npm install ignore sharp
6041

61-
if [ -z "$EXISTING_FILES" ]; then
62-
echo "No existing markdown files found after filtering."
63-
exit 0
42+
- name: Run validate document script
43+
run: |
44+
FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep '\.mdx$')
45+
echo "Changed document files: $FILES"
46+
if [ -z "$FILES" ]; then
47+
echo "No document files changed."
48+
exit 0
49+
fi
50+
51+
# Filter out files that no longer exist
52+
EXISTING_FILES=""
53+
for FILE in $FILES; do
54+
if [ -f "$FILE" ]; then
55+
EXISTING_FILES="$EXISTING_FILES $FILE"
56+
else
57+
echo "Warning: File '$FILE' no longer exists and will be skipped."
6458
fi
59+
done
60+
61+
if [ -z "$EXISTING_FILES" ]; then
62+
echo "No existing markdown files found after filtering."
63+
exit 0
64+
fi
6565
66-
node website/validate-document.js $EXISTING_FILES
66+
node website/validate-document.js $EXISTING_FILES

0 commit comments

Comments
 (0)