| 31 | } |
| 32 | |
| 33 | func (gi *githubImporter) Init(_ context.Context, repo *cache.RepoCache, conf core.Configuration) error { |
| 34 | gi.conf = conf |
| 35 | creds, err := auth.List(repo, |
| 36 | auth.WithTarget(target), |
| 37 | auth.WithKind(auth.KindToken), |
| 38 | auth.WithMeta(auth.MetaKeyLogin, conf[confKeyDefaultLogin]), |
| 39 | ) |
| 40 | if err != nil { |
| 41 | return err |
| 42 | } |
| 43 | if len(creds) <= 0 { |
| 44 | return ErrMissingIdentityToken |
| 45 | } |
| 46 | gi.client = buildClient(creds[0].(*auth.Token)) |
| 47 | |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | // ImportAll iterate over all the configured repository issues and ensure the creation of the |
| 52 | // missing issues / timeline items / edits / label events ... |