Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check docs

# Runs the knowledge base contract checks on every pull request, so a problem
# that would make the release-time publish fail shows up here first.
#
# The same checker publish-docs runs, but nothing is packed or released.
# Errors fail the check. Warnings are annotated on the run and listed in the
# job summary; add `strict: true` below to fail on warnings as well.
#
# This repo is the template other docs repos copy. Keep this file minimal:
# checkout, setup-python, the same build as pack.yml, one `uses:`.

on:
pull_request:

permissions:
contents: read

jobs:
check:
name: Build headless + check against the knowledge base contract
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Build (headless)
run: python scripts/pack.py --headless

- uses: AbsaOSS/knowledge-base/actions/check-docs@v1
with:
manifest: kb-docs.json
dist: dist
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ section: Optional Section Name

- Normative spec: `contract/ARTIFACT.md`, `contract/HEADLESS_RULES.md`, `contract/kb-docs.schema.json` in AbsaOSS/knowledge-base
- Publishing: `.github/workflows/pack.yml` runs on `release: published` (checkout → setup-python → `pack.py --headless` → `actions/publish-docs@v1`). Keep it minimal — this repo is the template other docs repos copy
- PR check: `.github/workflows/check-docs.yml` runs on `pull_request` with the same build, then `actions/check-docs@v1` (same contract checks, no release; errors fail, warnings annotated, `strict` off). Preview locally: `node ../knowledge-base/actions/lib/check-cli.js --manifest kb-docs.json --dist dist`
- Registry entry in the knowledge base is just `{ "repo": "AbsaOSS/knowledge-base-docs-example", "version": "latest" }`; all display metadata lives in `kb-docs.json` here
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Built with [MkDocs](https://www.mkdocs.org/) — no Node.js required.
| `kb-docs.json` | Knowledge base manifest (contract v1) |
| `scripts/` | Build scripts (`pack.py`, `pack.sh`) |
| `.github/workflows/pack.yml` | Publishes `kb-docs.tar.gz` to the knowledge base on every GitHub Release |
| `.github/workflows/check-docs.yml` | Runs the same contract checks on every pull request |

## Quick start

Expand Down Expand Up @@ -73,6 +74,10 @@ to `AbsaOSS/knowledge-base/actions/publish-docs`, which validates them against t
contract, packs `kb-docs.tar.gz` and attaches it to the release. The knowledge base
fetches this artifact automatically.

The `Check docs` workflow runs the same checks on every pull request
(`AbsaOSS/knowledge-base/actions/check-docs`), without releasing anything. Errors fail
the pull request; warnings are annotated and listed in the job summary.

## Registering in the knowledge base

Add a two-line entry to `apps.json` in the knowledge base repo:
Expand Down
Loading