Skip to content

Commit e734aaa

Browse files
committed
ci(github actions): reject github style admonitions
syncing docs from readme of repo to this repo's docs requires changing github style admonitions to docusaurus style ones
1 parent 14c1005 commit e734aaa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/test-deploy.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,17 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: npm ci
25+
- name: Check for GitHub-style admonitions in markdown files
26+
run: |
27+
# Search for the `> [!` pattern locally in .md and .mdx files
28+
files_with_admonitions=$(grep -rl '> \[!' --include='*.md' --include='*.mdx' ./)
29+
if [[ -n "$files_with_admonitions" ]]; then
30+
echo "Error: Found GitHub-style admonitions (e.g., '> [!') in the following files:"
31+
echo "$files_with_admonitions"
32+
echo "Please replace them with Docusaurus-compatible admonitions (e.g., ':::note')."
33+
exit 1 # Fail the workflow to indicate that GitHub-style admonitions should not be used
34+
else
35+
echo "No GitHub-style admonitions found. All markdown files are Docusaurus compatible."
36+
fi
2537
- name: Test build website
2638
run: npm run build

0 commit comments

Comments
 (0)