name: Site docs
on:
push:
branches: [main]
paths: ['docs/site/**', 'scripts/validate-site-docs.mjs', '.github/workflows/site-docs.yml']
pull_request:
branches: [main]
paths: ['docs/site/**', 'scripts/validate-site-docs.mjs', '.github/workflows/site-docs.yml']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
validate:
name: Validate page frontmatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with:
node-version: '24'
- name: Validate docs/site/**/*.md frontmatter
run: node scripts/validate-site-docs.mjs
- name: Reject edits to a frozen snapshot
if: github.event_name == 'pull_request'
env:
BASE: ${{ github.event.pull_request.base.sha }}
run: |
edited=$(git diff --diff-filter=MD --name-only "$BASE...HEAD" -- 'docs/site/docs-v*' 'docs/site/docs-fr-v*')
if [ -n "$edited" ]; then
echo "These pages belong to a frozen version and must not be changed or removed:"
echo "$edited" | sed 's/^/ /'
echo
echo "Fix the current docs under docs/site/docs-en/ or docs/site/docs-fr/ instead."
exit 1
fi
echo "No frozen snapshot touched."