feat: repo_mirror_push tools (add/list/delete push mirrors) #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a
repo_mirror_pushtool to configure a push mirror from a Gitea repo to an external remote (e.g. GitHub). This enables the GitHub-as-master workflow where GitHub is canonical and Gitea mirrors from it — or the inverse where Gitea pushes to GitHub after each commit.Gitea API
POST /api/v1/repos/{owner}/{repo}/push_mirrorsGET /api/v1/repos/{owner}/{repo}/push_mirrorsDELETE /api/v1/repos/{owner}/{repo}/push_mirrors/{name}Tool spec
Required token permission
write:repositoryscope on the Gitea API token.Risk classification
repo_mirror_push_add: MEDIUM — involves storing a remote credential in Gitea.repo_mirror_push_list: LOW — read-only.repo_mirror_push_delete: MEDIUM — removes sync configuration.Security note
remote_password(GitHub token) must never be logged or returned in tool output. Gitea stores it encrypted — the tool should confirm storage but not echo the value back.Motivation
ADR (2026-05-14): GitHub is canonical remote, Gitea mirrors via push-mirror. Setting this up for all existing repos currently requires web UI per repo.
hyperguild new-projectshould call this tool as part of repo initialisation to wire up the GitHub mirror automatically.Dependency
Pairs with
repo_create(#13) — new-project flow: create on Gitea → add push mirror to GitHub.Shipped in v0.2.2. Closing during cleanup pass.