feat(tool): sync-wiki.sh — docs/wiki/ ins GitHub-Wiki spiegeln - #117
Merged
Merged
Conversation
docs/wiki/ ist die Quelle, das GitHub-Wiki die veröffentlichte Kopie (Einbahnstraße — Wiki-Edits überschreibt der nächste Lauf). Das Script klont das .wiki.git, kopiert die *.md 1:1 hinein, entfernt Seiten, die im Repo nicht mehr existieren, und committet/pusht. Vorschau ist der Default; ohne --push geht nichts nach GitHub. Der Wiki-Slug kommt aus dem Remote (origin, per --remote umstellbar), der Push nutzt den gh-Credential-Helper inline, ohne ~/.gitconfig anzufassen. _Sidebar.md wandert als Wiki-Navigation mit nach docs/wiki/ — damit ist der Spiegel ein reines "cp docs/wiki/*.md". Verifiziert (Vorschau, Wiki-HEAD blieb ff3fe89): - no-op gegen den Live-Stand -> "nothing to do" - geänderte Seite -> Stat + "preview only" - im Repo gelöschte Seite -> "delete:" + Stat - leeres docs/wiki -> Abbruch, exit 1 - --help / unbekanntes Flag -> exit 2 / exit 0 - Slug-Auflösung: git@, https://…(.git), ssh:// — alle vier Formen Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Remote-host validation and safe handling of destination symlinks must be addressed.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds a one-way synchronization tool for mirroring repository-managed wiki documentation to the GitHub Wiki.
Changes:
- Adds preview and push modes with exact page mirroring.
- Adds version-controlled GitHub Wiki navigation.
| File | Description |
|---|---|
tool/sync-wiki.sh |
Implements wiki cloning, synchronization, deletion, and pushing. |
docs/wiki/_Sidebar.md |
Defines navigation for the mirrored wiki. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+63
to
+64
| SLUG="$(printf '%s' "$URL" | | ||
| sed -E 's#^git@[^:]+:##; s#^[a-z+]+://[^/]+/##; s#\.git$##; s#/$##')" |
| git clone --quiet "https://github.com/$SLUG.wiki.git" "$WORK/wiki" | ||
| BRANCH="$(git -C "$WORK/wiki" symbolic-ref --short HEAD)" | ||
|
|
||
| cp "$ROOT/$SRC"/*.md "$WORK/wiki/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Was
tool/sync-wiki.shspiegeltdocs/wiki/*.mdins GitHub-Wiki des Repos(https://github.com/Toqsick/master-linux-assistant/wiki).
Richtung ist Einbahnstraße Repo → Wiki.
docs/wiki/bleibt die Quelle; eine Seite, die direkt imGitHub-Wiki editiert wird, überschreibt der nächste Lauf. Der Spiegel ist exakt: eine Seite, die im
Repo nicht mehr existiert, wird auch im Wiki gelöscht (mit eigener
delete:-Zeile im Log, damit dasim Vorschau-Output nicht untergeht).
Das Wiki ist bereits mit dem Stand von
mainbefüllt (Commitff3fe89) — dieser PR liefert nur dasWerkzeug dafür, plus
docs/wiki/_Sidebar.mdals Quelle der Wiki-Navigation. Damit ist der Spiegel einreines
cp docs/wiki/*.mdund die Navigation ist mitversioniert statt nur im Wiki zu leben.Nutzung
Der Wiki-Slug wird aus dem Remote abgeleitet (
origin, per--remoteumstellbar — funktioniert mitgit@…,https://…undssh://…). Gepusht wird mit dem gh-Credential-Helper inline(
git -c credential.helper='!gh auth git-credential'),~/.gitconfigwird nicht angefasst.Verifikation
Alle Läufe als Vorschau in einem isolierten Klon; der Wiki-HEAD blieb durchgehend
ff3fe89:wiki already matches docs/wiki — nothing to do.preview only — re-run with --push to mirror.delete: Roadmap.md+ Statdocs/wiki/exit 1--help/ unbekanntes Flagexit 0/exit 2git@,https://…(.git),ssh://…→ alle korrektNicht abgedeckt: der tatsächliche
--push-Lauf (bewusst nicht ausgeführt, um die Wiki-Historie nichtmit Test-Commits zu füllen) — der Erst-Spiegel lief aber bereits manuell mit exakt demselben
Push-Kommando, das das Script jetzt verwendet.
Danach
Nach dem Merge von #116 einmalig
tool/sync-wiki.sh --push— dann stehen auch die dreiScreen-Tool-Pattern-Links auf „Modul-Registry" und der Release-Prozess ohne RPM im Wiki.🤖 Generated with Claude Code