Add the wiki publishing workflow #45

Merged
Tirsvad merged 1 commits from mil-005-wiki-publishing-workflow into main 2026-10-10 03:06:39 +02:00
Owner

Adds the wiki publishing workflow (MIL-005 task 8).

Changes

  • tools/publish_wiki.py makes the Gitea wiki equal wiki/ through the wiki REST API: it creates new pages, updates changed ones (unchanged pages are skipped), and deletes pages that are not in wiki/. An empty or missing wiki/ aborts before any request, so the wiki cannot be wiped by mistake.
  • .gitea/workflows/publish-wiki.yml runs on push to main when wiki/** changes, and on manual dispatch. It has read-only permissions, serialised runs, runs build_wiki.py --check first and takes the new secret TOKEN_FOR_GITEA_WIKI through the environment only.
  • Errors use the same categories as the metadata sync (configuration, credentials, permissions, api); the token is never printed.
  • tests/test_publish_wiki.py (30 tests, offline, fake Gitea) covers the publish plan, error categories and the workflow's triggers, permissions and step order. Full suite: 120 passed.
  • guides/credentials.md, guides/troubleshooting.md and the README Requirements describe the secret and the new messages.

Wiki pages changed (rule 8)

Home, Credentials, Troubleshooting (regenerated with tools/build_wiki.py).

Notes

  • The task text says .gitea/scoped_workflows/. The workflow is in .gitea/workflows/ with a checkout because it publishes this repository's own wiki/ folder; scoped workflows apply across repositories and have no checkout.
  • The endpoints and request fields were checked against the instance's swagger.v1.json (Gitea 1.27.3). The workflow has not run against the real wiki: the secret does not exist yet (issue #33: S05 approves the scope, S03 stores it). The wiki repository has never been initialised; the first publish creates it.
  • Gitea has no wiki-only token scope; the guide recommends a dedicated user with write access to this repository only. S05 should confirm.

Closes #42

Adds the wiki publishing workflow (MIL-005 task 8). ## Changes - `tools/publish_wiki.py` makes the Gitea wiki equal `wiki/` through the wiki REST API: it creates new pages, updates changed ones (unchanged pages are skipped), and deletes pages that are not in `wiki/`. An empty or missing `wiki/` aborts before any request, so the wiki cannot be wiped by mistake. - `.gitea/workflows/publish-wiki.yml` runs on push to `main` when `wiki/**` changes, and on manual dispatch. It has read-only permissions, serialised runs, runs `build_wiki.py --check` first and takes the new secret `TOKEN_FOR_GITEA_WIKI` through the environment only. - Errors use the same categories as the metadata sync (configuration, credentials, permissions, api); the token is never printed. - `tests/test_publish_wiki.py` (30 tests, offline, fake Gitea) covers the publish plan, error categories and the workflow's triggers, permissions and step order. Full suite: 120 passed. - `guides/credentials.md`, `guides/troubleshooting.md` and the README Requirements describe the secret and the new messages. ## Wiki pages changed (rule 8) Home, Credentials, Troubleshooting (regenerated with `tools/build_wiki.py`). ## Notes - The task text says `.gitea/scoped_workflows/`. The workflow is in `.gitea/workflows/` with a checkout because it publishes this repository's own `wiki/` folder; scoped workflows apply across repositories and have no checkout. - The endpoints and request fields were checked against the instance's `swagger.v1.json` (Gitea 1.27.3). The workflow has not run against the real wiki: the secret does not exist yet (issue #33: S05 approves the scope, S03 stores it). The wiki repository has never been initialised; the first publish creates it. - Gitea has no wiki-only token scope; the guide recommends a dedicated user with write access to this repository only. S05 should confirm. Closes #42
Tirsvad added 1 commit 2026-10-10 03:06:20 +02:00
Add the wiki publishing workflow
Validate workflows / validate (pull_request) Successful in 15s
1472513421
Add tools/publish_wiki.py and the Publish wiki workflow, which make the
Gitea wiki equal wiki/ through the wiki REST API when a change to wiki/ is
merged to main. It needs its own secret TOKEN_FOR_GITEA_WIKI, refuses an
empty source and checks that the English pages are current first.

Document the secret in the credentials and troubleshooting guides and
regenerate the affected wiki pages.

Task: MIL-005#8
Tirsvad merged commit 611d665508 into main 2026-10-10 03:06:39 +02:00
Sign in to join this conversation.