Skip to content

Commit f8ccc7f

Browse files
committed
fix the way we get GITHUB TOKEN
1 parent bed45e7 commit f8ccc7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/ctrlc/root/sync/github/pullrequest.go renamed to cmd/ctrlc/root/sync/github/pullrequests.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package github
33
import (
44
"context"
55
"fmt"
6+
"os"
67
"strconv"
78
"strings"
89
"time"
@@ -128,7 +129,7 @@ func runSync(repoPath, token, name *string, states *[]string) func(cmd *cobra.Co
128129
githubToken := *token
129130
if githubToken == "" {
130131
log.Debug("Token not provided via flag, checking environment")
131-
githubToken = viper.GetString("GITHUB_TOKEN")
132+
githubToken = os.Getenv("GITHUB_TOKEN")
132133
if githubToken == "" {
133134
log.Debug("GitHub token not found in environment")
134135
return fmt.Errorf("GitHub token is required (use --token flag or set GITHUB_TOKEN env var)")

0 commit comments

Comments
 (0)