Fix mobile sidebar closed state #152
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs Quality Gate | |
| on: | |
| pull_request: | |
| paths: | |
| - "docs/**" | |
| - "manuscript/**" | |
| - ".github/**" | |
| - "scripts/**" | |
| - "package.json" | |
| - "package-lock.json" | |
| - "AI_USAGE_POLICY.md" | |
| - "AGENTS.md" | |
| - "CONTRIBUTING.md" | |
| - "UPDATE_POLICY.md" | |
| - "README.md" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "docs/**" | |
| - "manuscript/**" | |
| - ".github/**" | |
| - "scripts/**" | |
| - "package.json" | |
| - "package-lock.json" | |
| - "AI_USAGE_POLICY.md" | |
| - "AGENTS.md" | |
| - "CONTRIBUTING.md" | |
| - "UPDATE_POLICY.md" | |
| - "README.md" | |
| workflow_dispatch: {} | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| docs-quality-gate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci --no-fund --no-audit | |
| - name: Dependency audit | |
| run: npm audit | |
| - name: Collect changed Markdown files (docs/manuscript/etc) | |
| id: changes | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then | |
| base="${{ github.event.pull_request.base.sha }}" | |
| head="${{ github.event.pull_request.head.sha }}" | |
| else | |
| base="${{ github.event.before }}" | |
| head="${GITHUB_SHA}" | |
| fi | |
| invalid_base=false | |
| if [ -z "${base}" ] || [ "${base}" = "0000000000000000000000000000000000000000" ]; then | |
| invalid_base=true | |
| elif ! git cat-file -e "${base}^{commit}" 2>/dev/null; then | |
| invalid_base=true | |
| fi | |
| if [ "${invalid_base}" = true ]; then | |
| echo "Base SHA is invalid or unavailable; falling back to all tracked markdown files under target paths." | |
| git ls-files docs manuscript .github AI_USAGE_POLICY.md AGENTS.md CONTRIBUTING.md UPDATE_POLICY.md README.md | grep -E '\.md$' > changed-md.txt || true | |
| else | |
| # Exclude deleted files to avoid lint/link-check failures on missing paths. | |
| git diff --name-only --diff-filter=ACMRT "$base" "$head" -- docs manuscript .github AI_USAGE_POLICY.md AGENTS.md CONTRIBUTING.md UPDATE_POLICY.md README.md | grep -E '\.md$' > changed-md.txt || true | |
| fi | |
| echo "Changed markdown files:" | |
| if [ -s changed-md.txt ]; then | |
| cat changed-md.txt | |
| else | |
| echo "(none)" | |
| fi | |
| - name: Markdown lint (changed only) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ ! -s changed-md.txt ]; then | |
| echo "Skip: no markdown changes." | |
| exit 0 | |
| fi | |
| cat changed-md.txt | xargs -r npx markdownlint | |
| - name: Internal link check (changed only) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ ! -s changed-md.txt ]; then | |
| echo "Skip: no markdown changes." | |
| exit 0 | |
| fi | |
| cat changed-md.txt | xargs -r python3 scripts/check_markdown_internal_links.py |