1
0
Fork 0
mirror of https://github.com/Luzifer/github2gitea.git synced 2024-12-22 12:01:20 +00:00

Add flag for not migrating forks

This commit is contained in:
Knut Ahlers 2019-07-27 09:55:30 +02:00
parent 3602b68599
commit 1a5272283d
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -26,6 +26,7 @@ var (
GithubToken string `flag:"github-token" default:"" description:"Github access token" validate:"nonzero"`
LogLevel string `flag:"log-level" default:"info" description:"Log level (debug, info, warn, error, fatal)"`
MigrateArchived bool `flag:"migrate-archived" default:"false" description:"Create migrations for archived repos"`
MigrateForks bool `flag:"migrate-forks" default:"false" description:"Create migrations for forked repos"`
MigratePrivate bool `flag:"migrate-private" default:"true" description:"Migrate private repos (the given Github Token will be entered as sync credential!)"`
SourceExpression string `flag:"source-expression" default:"" description:"Regular expression to match the full name of the source repo (i.e. '^Luzifer/.*$')" validate:"nonzero"`
TargetUser int64 `flag:"target-user" default:"0" description:"ID of the User / Organization in Gitea to assign the repo to" validate:"nonzero"`
@ -111,6 +112,11 @@ func fetchGithubRepos() ([]*github.Repository, error) {
continue
}
if !cfg.MigrateForks && boolFromPtr(r.Fork) {
log.WithField("repo", *r.FullName).Debug("Skip: Fork")
continue
}
allRepos = append(allRepos, r)
}