perf(hypatia-scan): cache built scanner keyed on Hypatia HEAD + shallow clone #778
Workflow file for this run
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
| # SPDX-License-Identifier: MPL-2.0 | |
| name: Documentation Format Enforcement | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| # Estate guardrail: cancel superseded runs so re-pushes / rebased PR | |
| # updates do not pile up queued runs against the shared account-wide | |
| # Actions concurrency pool. Applied only to read-only check workflows | |
| # (no publish/mutation), so cancelling a superseded run is always safe. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-doc-format: | |
| timeout-minutes: 10 | |
| name: Check Documentation Format | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v4 | |
| - name: Check for duplicate documentation formats | |
| run: | | |
| DUPLICATES=0 | |
| # Check for docs that exist in both .md and .adoc (except GitHub-required) | |
| for doc in README ARCHITECTURE ROADMAP PHILOSOPHY INSTALL CHANGELOG; do | |
| if [ -f "${doc}.md" ] && [ -f "${doc}.adoc" ]; then | |
| # Glama carve-out: the Glama MCP-server directory (glama.ai) requires a | |
| # README.md to index a server and will NOT render README.adoc. When a | |
| # glama.json is present, README.md is permitted alongside the canonical | |
| # README.adoc. README.adoc remains the source of truth. This is a Glama | |
| # limitation, not an owner-policy change. See contractiles/CANONICAL-TEMPLATES.adoc. | |
| if [ "${doc}" = "README" ] && [ -f "glama.json" ]; then | |
| echo "::notice::README.md kept alongside README.adoc (Glama carve-out: glama.json present; .adoc remains canonical)." | |
| continue | |
| fi | |
| echo "::error::Duplicate documentation: ${doc}.md and ${doc}.adoc both exist. Keep only .adoc" | |
| DUPLICATES=$((DUPLICATES + 1)) | |
| fi | |
| done | |
| # CONTRIBUTING can have both but .md should just be a redirect | |
| if [ -f "CONTRIBUTING.md" ] && [ -f "CONTRIBUTING.adoc" ]; then | |
| if ! grep -q "See.*CONTRIBUTING.adoc" CONTRIBUTING.md 2>/dev/null; then | |
| echo "::warning::CONTRIBUTING.md exists alongside CONTRIBUTING.adoc but is not a redirect" | |
| fi | |
| fi | |
| if [ $DUPLICATES -gt 0 ]; then | |
| echo "::error::Found $DUPLICATES duplicate documentation files" | |
| exit 1 | |
| fi | |
| echo "✓ No duplicate documentation formats found" | |
| - name: Check documentation uses .adoc | |
| run: | | |
| # List of files that MUST be .md for GitHub community health | |
| # SECURITY.md, CONTRIBUTING.md (can redirect), CODE_OF_CONDUCT.md, CHANGELOG.md | |
| # Check README is .adoc (not .md) | |
| if [ -f "README.md" ] && [ ! -f "README.adoc" ]; then | |
| echo "::warning::README.md found without README.adoc. Consider converting to AsciiDoc." | |
| fi | |
| # Check other docs are .adoc | |
| for doc in ARCHITECTURE ROADMAP PHILOSOPHY INSTALL; do | |
| if [ -f "${doc}.md" ]; then | |
| echo "::warning::${doc}.md should be ${doc}.adoc" | |
| fi | |
| done | |
| echo "✓ Documentation format check complete" | |
| - name: Verify GitHub-required files exist | |
| run: | | |
| # These files are required/preferred by GitHub in .md format | |
| MISSING=0 | |
| if [ ! -f "SECURITY.md" ]; then | |
| echo "::warning::SECURITY.md not found (required for GitHub security tab)" | |
| fi | |
| if [ ! -f "LICENSE.txt" ] && [ ! -f "LICENSE" ]; then | |
| echo "::warning::LICENSE file not found" | |
| fi | |
| echo "✓ GitHub-required files check complete" |