Skip to content

docs(ci): Add documentation audit CI/CD workflow #569

Description

@kcenon

What

Add a GitHub Actions workflow that runs the documentation audit tool on every PR
that modifies docs/ files, and on a weekly schedule for full ecosystem audits.

Why

Documentation quality degrades without continuous enforcement. A CI workflow
ensures that PRs introducing broken links, missing frontmatter, or SSOT
inconsistencies are caught before merge. Weekly ecosystem-wide audits detect
cross-project drift.

Where

Repository File Action
All 8 projects .github/workflows/doc-audit.yml Add
common_system .github/workflows/doc-audit-ecosystem.yml Add (weekly)

How

Per-Project Workflow

name: Documentation Audit
on:
  pull_request:
    paths:
      - 'docs/**'
      - 'README.md'
      - 'README.kr.md'
      - 'CLAUDE.md'

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install audit tool
        run: pip install pyyaml

      - name: Fetch audit tool
        run: |
          gh api repos/kcenon/common_system/tarball/main | \
            tar xz --strip-components=2 -C /tmp '*/tools/doc-audit'
        env:
          GH_TOKEN: ${{ github.token }}

      - name: Run audit
        run: python -m doc_audit . --quick --format markdown

      - name: Comment on PR
        if: failure()
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const report = fs.readFileSync('audit-report.md', 'utf8');
            github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body: report
            });

Ecosystem Weekly Audit (common_system only)

name: Ecosystem Documentation Audit
on:
  schedule:
    - cron: '23 3 * * 1'  # Monday 3:23 AM UTC
  workflow_dispatch:

jobs:
  audit:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        repo:
          - common_system
          - thread_system
          - logger_system
          - container_system
          - monitoring_system
          - database_system
          - network_system
          - pacs_system
    steps:
      - uses: actions/checkout@v4
        with:
          repository: kcenon/${{ matrix.repo }}

      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Run audit
        run: python -m doc_audit . --format json

      - uses: actions/upload-artifact@v4
        with:
          name: audit-${{ matrix.repo }}
          path: audit-report.json

Acceptance Criteria

  • doc-audit.yml deployed to all 8 repos
  • doc-audit-ecosystem.yml deployed to common_system
  • PR workflow triggers only on docs/ file changes
  • Audit failures block PR merge (required check)
  • Weekly ecosystem audit runs and produces artifacts
  • PR comment includes audit findings on failure

Related

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions