Documentation
¶
Index ¶
- Variables
- func BuildExcludePaths(noWorkflows, noActions, noCopilot, noGitHub bool, extraPaths []string) ([]string, error)
- func CleanTargetReleases(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, ...) error
- func CleanupExcludedPaths(host, owner, repo, token string, paths []string, verbose bool) error
- func CopyIssues(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, ...) error
- func CopyPullRequests(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, ...) error
- func CopyReleases(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, ...) error
- func CopyWiki(...) error
- func MirrorRepo(...) ([]string, error)
- func SyncReleases(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( WorkflowPaths = []string{".github/workflows"} ActionsPaths = []string{".github/actions"} CopilotPaths = []string{ ".github/copilot-instructions.md", ".github/copilot", } GitHubDirPath = []string{".github"} // CodeOwnersPaths are always removed because CODEOWNERS references // teams/users that typically don't exist in the target org. CodeOwnersPaths = []string{ "CODEOWNERS", ".github/CODEOWNERS", "docs/CODEOWNERS", } )
Well-known path sets for preset exclusion flags.
Functions ¶
func BuildExcludePaths ¶
func BuildExcludePaths(noWorkflows, noActions, noCopilot, noGitHub bool, extraPaths []string) ([]string, error)
BuildExcludePaths merges preset flags, user-supplied --exclude paths, and always-excluded paths (CODEOWNERS) into a single deduplicated list. When noGitHub is true, it supersedes noWorkflows, noActions, and noCopilot since the entire .github directory is removed.
func CleanTargetReleases ¶
func CleanTargetReleases(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, verbose bool) error
CleanTargetReleases deletes all releases in the target repo that don't exist in the source. Used by --force to prevent orphaned releases after mirror push.
func CleanupExcludedPaths ¶
CleanupExcludedPaths clones the target repo, removes the specified paths, and pushes a cleanup commit. This is a post-push operation that preserves full history — the cleanup appears as a single new commit.
func CopyIssues ¶
func CopyIssues(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, verbose bool) error
CopyIssues migrates all issues from source to target repository.
func CopyPullRequests ¶
func CopyPullRequests(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, verbose bool) error
CopyPullRequests migrates PRs as issues (PRs cannot be recreated via API).
func CopyReleases ¶
func CopyReleases(src, tgt *ghclient.Client, srcOwner, srcRepo, tgtOwner, tgtRepo string, verbose bool) error
CopyReleases migrates all releases and their assets from source to target.
func CopyWiki ¶
func CopyWiki(srcHost, srcOwner, srcName, tgtHost, tgtOrg, tgtName, srcToken, tgtToken string, verbose bool) error
CopyWiki clones and pushes the wiki repository.
func MirrorRepo ¶
func MirrorRepo(srcHost, srcOwner, srcName, tgtHost, tgtOrg, tgtName, srcToken, tgtToken string, lfs, forceOverwrite, codeOnly, verbose bool) ([]string, error)
MirrorRepo performs a bare clone from source and pushes to target. forceOverwrite: uses --mirror (destructive). codeOnly: pushes only branches (no tags). Default (both false): pushes branches + new tags (additive). Returns the list of rejected refs (e.g. "refs/heads/main") if any branches were rejected by the remote due to branch protection or org rulesets.
Types ¶
This section is empty.