Skip to content

fix(ci): un-stale the Hypatia scanner cache + tolerate header-less verbatim LICENSE #873

fix(ci): un-stale the Hypatia scanner cache + tolerate header-less verbatim LICENSE

fix(ci): un-stale the Hypatia scanner cache + tolerate header-less verbatim LICENSE #873

Workflow file for this run

# 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- name: Check for duplicate documentation formats
run: |
DUPLICATES=0
# .adoc-primary docs: keep only .adoc. README is NOT here — README is a
# GitHub-required Markdown file (see the README rule below).
for doc in ARCHITECTURE ROADMAP PHILOSOPHY INSTALL; do
if [ -f "${doc}.md" ] && [ -f "${doc}.adoc" ]; then
echo "::error::Duplicate documentation: ${doc}.md and ${doc}.adoc both exist. Keep only .adoc"
DUPLICATES=$((DUPLICATES + 1))
fi
done
# README MUST be Markdown: it renders in GitHub community-health, the GitHub
# profile, and external MCP directories (Glama) — all of which show AsciiDoc
# as raw markup. So README.md is canonical; README.adoc is a duplicate to remove.
if [ -f "README.md" ] && [ -f "README.adoc" ]; then
echo "::error::Duplicate README: keep README.md (required Markdown); remove README.adoc."
DUPLICATES=$((DUPLICATES + 1))
fi
# 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 format
run: |
# Files that MUST be .md for GitHub community-health / profile / Glama:
# README.md, SECURITY.md, CONTRIBUTING.md (can redirect), CODE_OF_CONDUCT.md, CHANGELOG.md
# README must be Markdown. A lone README.adoc renders as raw markup in
# community-health/profile/Glama — nudge to convert (warning during the
# estate-wide migration; the duplicate case above is the hard error).
if [ -f "README.adoc" ] && [ ! -f "README.md" ]; then
echo "::warning::README.adoc without README.md — README must be Markdown (renders raw as AsciiDoc in community-health/profile/Glama). Convert to README.md."
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"