bridge/github: use core.ConfigKeyToken instead of keyToken

amine created

Change summary

bridge/github/export.go | 6 +++---
bridge/github/import.go | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)

Detailed changes

bridge/github/export.go 🔗

@@ -87,14 +87,14 @@ func (ge *githubExporter) ExportAll(ctx context.Context, repo *cache.RepoCache,
 		return nil, err
 	}
 
-	ge.identityToken[user.Id()] = ge.conf[keyToken]
+	ge.identityToken[user.Id()] = ge.conf[core.ConfigKeyToken]
 
 	// get repository node id
 	ge.repositoryID, err = getRepositoryNodeID(
 		ctx,
 		ge.conf[keyOwner],
 		ge.conf[keyProject],
-		ge.conf[keyToken],
+		ge.conf[core.ConfigKeyToken],
 	)
 
 	if err != nil {
@@ -512,7 +512,7 @@ func (ge *githubExporter) createGithubLabel(ctx context.Context, label, color st
 	req = req.WithContext(ctx)
 
 	// need the token for private repositories
-	req.Header.Set("Authorization", fmt.Sprintf("token %s", ge.conf[keyToken]))
+	req.Header.Set("Authorization", fmt.Sprintf("token %s", ge.conf[core.ConfigKeyToken]))
 
 	resp, err := client.Do(req)
 	if err != nil {

bridge/github/import.go 🔗

@@ -39,7 +39,7 @@ func (gi *githubImporter) Init(conf core.Configuration) error {
 // ImportAll iterate over all the configured repository issues and ensure the creation of the
 // missing issues / timeline items / edits / label events ...
 func (gi *githubImporter) ImportAll(ctx context.Context, repo *cache.RepoCache, since time.Time) (<-chan core.ImportResult, error) {
-	gi.iterator = NewIterator(ctx, 10, gi.conf[keyOwner], gi.conf[keyProject], gi.conf[keyToken], since)
+	gi.iterator = NewIterator(ctx, 10, gi.conf[keyOwner], gi.conf[keyProject], gi.conf[core.ConfigKeyToken], since)
 	out := make(chan core.ImportResult)
 	gi.out = out
 
@@ -553,7 +553,7 @@ func (gi *githubImporter) getGhost(repo *cache.RepoCache) (*cache.IdentityCache,
 		"login": githubv4.String("ghost"),
 	}
 
-	gc := buildClient(gi.conf[keyToken])
+	gc := buildClient(gi.conf[core.ConfigKeyToken])
 
 	ctx, cancel := context.WithTimeout(gi.iterator.ctx, defaultTimeout)
 	defer cancel()