mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
## What kind of change does this PR introduce? Docs update. Resolves DEPR-634. Stacked on #48664. The linter package and CI revision pins will be updated after [supa-mdx-lint#121](https://github.com/supabase-community/supa-mdx-lint/pull/121) merges and is released. ## What is the current behavior? Admonition body content can contain structural headings, which inherit prose spacing and produce awkward callout layouts. Standalone Docs actions are also rendered as ordinary body content in two places. | Before | | --- | | <img width="1264" height="840" alt="70168" src="https://github.com/user-attachments/assets/00aa7620-a6b4-452c-971f-b3ce2eda0e8c" /> | | _Recent violation with Markdown header in `children`. Notice the big gap up top._ | ## What is the new behavior? - Documents that admonition titles belong in the `title` prop, standalone calls to action belong in `actions`, and document sections belong outside admonitions. - Configures heading-inside-admonition violations as errors for the forthcoming linter release. - Moves the UI-library and wrapper dashboard buttons into the existing `actions` slot without changing the shared component. Validated with the forthcoming linter across all 810 Docs sources, Docs type-checking, targeted ESLint and Prettier checks, and desktop/mobile rendering. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified admonition guidelines for optional titles, headings, rich content, and standalone calls to action. * Improved guidance on when contextual links and interactive examples belong in admonition content. * **Style** * Updated documentation call-to-action buttons to use the designated actions area. * **Quality Improvements** * Added validation to prevent headings inside admonitions and maintain consistent formatting. * Updated documentation linting to apply the latest validation rules. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
63 lines
2.2 KiB
YAML
63 lines
2.2 KiB
YAML
name: '[Docs] Lint v2 (scheduled)'
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
lint-all:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: true
|
|
sparse-checkout: |
|
|
supa-mdx-lint.config.toml
|
|
supa-mdx-lint
|
|
apps/docs/content
|
|
- name: cache cargo
|
|
id: cache-cargo
|
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: da6838d8d6898f28ec9ab432353b2707db9df8f5
|
|
- name: install linter
|
|
if: steps.cache-cargo.outputs.cache-hit != 'true'
|
|
run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev da6838d8d6898f28ec9ab432353b2707db9df8f5
|
|
- name: run linter
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
supa-mdx-lint apps/docs/content || {
|
|
echo "Linter failed, attempting to fix errors..."
|
|
git config --global user.name 'github-docs-bot'
|
|
git config --global user.email 'github-docs-bot@supabase.com'
|
|
BRANCH_NAME="bot/docs-lint-fixes"
|
|
EXISTING_BRANCH=$(git ls-remote --heads origin $BRANCH_NAME)
|
|
if [[ -n "$EXISTING_BRANCH" ]]; then
|
|
git push origin --delete $BRANCH_NAME
|
|
fi
|
|
git checkout -b $BRANCH_NAME
|
|
supa-mdx-lint apps/docs/content --fix || FIX_FAILED=1
|
|
git add .
|
|
git commit -m '[bot] fix lint errors' || true
|
|
git push origin $BRANCH_NAME
|
|
gh pr create --title '[bot] fix lint errors' --body 'This PR fixes lint errors in the documentation.' --head $BRANCH_NAME
|
|
if [ "${FIX_FAILED:-0}" -eq 1 ]; then
|
|
echo "Fix did not correct all errors."
|
|
exit 1
|
|
fi
|
|
}
|