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:
parent
3602b68599
commit
1a5272283d
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue