Skip to content

Auto-sync docs/ to GitHub + Gitea wikis#4

Merged
recklessop merged 1 commit into
mainfrom
claude/pensive-easley-4abcbe
May 8, 2026
Merged

Auto-sync docs/ to GitHub + Gitea wikis#4
recklessop merged 1 commit into
mainfrom
claude/pensive-easley-4abcbe

Conversation

@recklessop
Copy link
Copy Markdown
Owner

Wiki sync

Mirrors docs/ to a wiki repo on every push to main that touches docs/. Single source of truth stays docs/; the wiki is a publishing target.

Bits

  • scripts/sync-wiki.ps1 — clones the wiki repo, copies and flattens markdown from docs/, rewrites in-repo links to wiki-style page slugs, generates _Sidebar.md, commits and pushes if anything changed. Idempotent. Reusable for both GitHub and Gitea.
  • .github/workflows/wiki-sync.yml — runs the script on every push to main under docs/** (plus workflow_dispatch for manual). Uses GITHUB_TOKEN with contents: write, no PAT needed.

One-time setup before this fires

  1. Settings → Features → ✅ Wikis
  2. Click "Create the first page" on the Wiki tab and save anything (the workflow overwrites it on first sync).

Page mapping

The slug transformation is in the script: docs/recipes/zerto-pre-post-scripts.md becomes wiki page Recipe-Zerto-Failover, etc. Editing the mapping table is how you add or rename pages.

Gitea

No Windows runner available there, so the script is invoked manually from a shell. Works the same way.

Generated with Claude Code

scripts/sync-wiki.ps1 clones a wiki repo, copies+flattens markdown
from docs/ with a slug mapping (e.g. recipes/zerto-pre-post-scripts.md
becomes the Recipe-Zerto-Failover page), rewrites in-repo markdown
links to wiki-style targets, generates a _Sidebar.md, and pushes back
if anything changed. Idempotent.

.github/workflows/wiki-sync.yml runs the sync on every push to main
that touches docs/ (or the sync tooling itself). Uses GITHUB_TOKEN
which has wiki write access via the contents:write permission.

For Gitea, no Windows runner is available, so the script is invoked
manually with a Gitea PAT in the URL. One-time setup for each remote:
enable Wiki in repo settings, create a Home page via the web UI to
initialize the wiki repo, then run the sync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@recklessop recklessop merged commit 8e514f2 into main May 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant