mirror of
https://github.com/Luzifer/github2gitea.git
synced 2024-12-23 04:21:19 +00:00
Add option to disable mirroring
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
5fafc594a8
commit
4158d83636
3 changed files with 4 additions and 1 deletions
|
@ -34,6 +34,7 @@ Usage of github2gitea:
|
||||||
--migrate-archived Create migrations for archived repos
|
--migrate-archived Create migrations for archived repos
|
||||||
--migrate-forks Create migrations for forked repos
|
--migrate-forks Create migrations for forked repos
|
||||||
--migrate-private Migrate private repos (the given Github Token will be entered as sync credential!) (default true)
|
--migrate-private Migrate private repos (the given Github Token will be entered as sync credential!) (default true)
|
||||||
|
--no-mirror Do not enable mirroring but instad do a one-time clone
|
||||||
--source-expression string Regular expression to match the full name of the source repo (i.e. '^Luzifer/.*$')
|
--source-expression string Regular expression to match the full name of the source repo (i.e. '^Luzifer/.*$')
|
||||||
--target-user int ID of the User / Organization in Gitea to assign the repo to
|
--target-user int ID of the User / Organization in Gitea to assign the repo to
|
||||||
--target-user-name string Username of the given ID (to check whether repo already exists)
|
--target-user-name string Username of the given ID (to check whether repo already exists)
|
||||||
|
@ -52,6 +53,7 @@ You can see there is a lot of options you need to set so here is a little walk-t
|
||||||
| `migrate-archived` | | Set to `true` to also create migrations for archived repos |
|
| `migrate-archived` | | Set to `true` to also create migrations for archived repos |
|
||||||
| `migrate-forks` | | Set to `true` to also create migrations for forked repos |
|
| `migrate-forks` | | Set to `true` to also create migrations for forked repos |
|
||||||
| `migrate-private` | | Set to `false` not to create migrations for private repos |
|
| `migrate-private` | | Set to `false` not to create migrations for private repos |
|
||||||
|
| `no-mirror` | | Set to `true` not to set up mirroring but only clone the repo |
|
||||||
| `source-expression` | X | Regular expression to match the *full name* of the repo: `^Luzifer/` will for example match `Luzifer/github2gitea` |
|
| `source-expression` | X | Regular expression to match the *full name* of the repo: `^Luzifer/` will for example match `Luzifer/github2gitea` |
|
||||||
| `target-user` | X | ID of your Gitea user or organization (ask your instance admin to look it up in the site admin) |
|
| `target-user` | X | ID of your Gitea user or organization (ask your instance admin to look it up in the site admin) |
|
||||||
| `target-user-name` | X | Name of the user the ID belongs to |
|
| `target-user-name` | X | Name of the user the ID belongs to |
|
||||||
|
|
2
gitea.go
2
gitea.go
|
@ -28,7 +28,7 @@ func createMigrationRequestFromGithubRepo(gr *github.Repository) createMigration
|
||||||
CloneAddr: strFromPtr(gr.CloneURL),
|
CloneAddr: strFromPtr(gr.CloneURL),
|
||||||
Description: strFromPtr(gr.Description),
|
Description: strFromPtr(gr.Description),
|
||||||
Issues: boolFromPtr(gr.HasIssues),
|
Issues: boolFromPtr(gr.HasIssues),
|
||||||
Mirror: true,
|
Mirror: !cfg.NoMirror,
|
||||||
Private: boolFromPtr(gr.Private),
|
Private: boolFromPtr(gr.Private),
|
||||||
PullRequests: boolFromPtr(gr.HasIssues),
|
PullRequests: boolFromPtr(gr.HasIssues),
|
||||||
RepoName: strFromPtr(gr.Name),
|
RepoName: strFromPtr(gr.Name),
|
||||||
|
|
1
main.go
1
main.go
|
@ -28,6 +28,7 @@ var (
|
||||||
MigrateArchived bool `flag:"migrate-archived" default:"false" description:"Create migrations for archived repos"`
|
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"`
|
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!)"`
|
MigratePrivate bool `flag:"migrate-private" default:"true" description:"Migrate private repos (the given Github Token will be entered as sync credential!)"`
|
||||||
|
NoMirror bool `flag:"no-mirror" default:"false" description:"Do not enable mirroring but instad do a one-time clone"`
|
||||||
SourceExpression string `flag:"source-expression" default:"" description:"Regular expression to match the full name of the source repo (i.e. '^Luzifer/.*$')" validate:"nonzero"`
|
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"`
|
TargetUser int64 `flag:"target-user" default:"0" description:"ID of the User / Organization in Gitea to assign the repo to" validate:"nonzero"`
|
||||||
TargetUserName string `flag:"target-user-name" default:"" description:"Username of the given ID (to check whether repo already exists)" validate:"nonzero"`
|
TargetUserName string `flag:"target-user-name" default:"" description:"Username of the given ID (to check whether repo already exists)" validate:"nonzero"`
|
||||||
|
|
Loading…
Reference in a new issue