mirror of
https://github.com/anotherhadi/github-recon.git
synced 2026-10-05 10:58:25 +02:00
Change the way token is retrieve
Signed-off-by: Hadi <[email protected]>
This commit is contained in:
@@ -163,7 +163,7 @@ func GetSettings() (settings Settings) {
|
||||
|
||||
// If token is not set via flag, get it from env
|
||||
if settings.Token == "null" || settings.Token == "" {
|
||||
settings.Token = getToken()
|
||||
settings.Token = GetToken()
|
||||
}
|
||||
|
||||
if settings.Token == "null" || settings.Token == "" {
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ import (
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
func getToken() string {
|
||||
// GetToken retrieves the GitHub token from the environment variable or config file
|
||||
func GetToken() string {
|
||||
token := os.Getenv("GITHUB_RECON_TOKEN")
|
||||
if token != "" {
|
||||
return token
|
||||
|
||||
Reference in New Issue
Block a user