Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/pr-build-and-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,61 @@ jobs:
- name: Run Tests
run: yarn test

docs-check:
name: Documentation Validation
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for docs changes
id: docs-changes
working-directory: .
run: |
DOCS_CHANGED=$(git diff --name-only origin/main...HEAD -- docs/ | grep '\.md$' || true)
if [ -z "$DOCS_CHANGED" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo "No markdown changes in docs/"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
DELIM=$(openssl rand -hex 8)
echo "changed_files<<$DELIM" >> "$GITHUB_OUTPUT"
echo "$DOCS_CHANGED" >> "$GITHUB_OUTPUT"
echo "$DELIM" >> "$GITHUB_OUTPUT"
echo "Changed docs files:"
echo "$DOCS_CHANGED"
fi

- name: Setup Node.js
if: steps.docs-changes.outputs.skip != 'true'
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Enable Corepack
if: steps.docs-changes.outputs.skip != 'true'
run: corepack enable

- name: Install docs dependencies
if: steps.docs-changes.outputs.skip != 'true'
run: yarn install --immutable

- name: Build documentation (validates internal links)
if: steps.docs-changes.outputs.skip != 'true'
run: yarn build

- name: Check external links in changed files
if: steps.docs-changes.outputs.skip != 'true'
run: |
FILES=$(echo "${{ steps.docs-changes.outputs.changed_files }}" | sed 's|^docs/||' | xargs)
echo "Checking files: $FILES"
yarn markdown-link-check --config .markdown-link-check.json $FILES

version-check:
name: Version Bump Check
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src/**/*.ts": ["eslint", "prettier --check"],
"{*.{js,ts,json,yml,yaml},.github/**/*.yml}": "prettier --check --ignore-unknown",
"docs/**/*.md": "yarn markdown-link-check --config docs/.markdown-link-check.json"
}
19 changes: 19 additions & 0 deletions docs/.markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"ignorePatterns": [
{ "pattern": "^<!--@include:" },
{ "pattern": "^/" },
{ "pattern": "^\\.{1,2}/" },
{ "pattern": "^#" }
],
"httpHeaders": [
{
"urls": ["https://github.com"],
"headers": { "Accept": "text/html" }
}
],
"timeout": "10s",
"retryOn429": true,
"retryCount": 3,
"fallbackRetryDelay": "5s",
"aliveStatusCodes": [200, 206, 301, 302]
}
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress preview"
"preview": "vitepress preview",
"lint:links": "markdown-link-check --config .markdown-link-check.json"
},
"devDependencies": {
"markdown-link-check": "^3.13.6",
"vitepress": "^1.5.0"
},
"engines": {
Expand Down
Loading
Loading