mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
Fix Gitea tokens not being found in config.yaml file (#287)
* Adds support for Gitea options in config.yaml file * Remove debug lines --------- Co-authored-by: anon <anon@desktop.localdomain>
This commit is contained in:
@@ -238,6 +238,8 @@ func InitConfig() {
|
||||
getOrSetDefaults("GHORG_RECLONE_PATH")
|
||||
getOrSetDefaults("GHORG_QUIET")
|
||||
getOrSetDefaults("GHORG_GIT_FILTER")
|
||||
getOrSetDefaults("GHORG_GITEA_TOKEN")
|
||||
getOrSetDefaults("GHORG_INSECURE_GITEA_CLIENT")
|
||||
|
||||
if os.Getenv("GHORG_DEBUG") != "" {
|
||||
viper.Debug()
|
||||
|
||||
@@ -168,6 +168,8 @@ func GetOrSetToken() {
|
||||
getOrSetGitLabToken()
|
||||
case "bitbucket":
|
||||
getOrSetBitBucketToken()
|
||||
default:
|
||||
getOrSetGiteaToken()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +229,18 @@ func getOrSetBitBucketToken() {
|
||||
}
|
||||
}
|
||||
|
||||
func getOrSetGiteaToken() {
|
||||
var token string
|
||||
token = os.Getenv("GHORG_GITEA_TOKEN")
|
||||
|
||||
if isZero(token) || len(token) != 40 {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
os.Setenv("GHORG_GITEA_TOKEN", token)
|
||||
}
|
||||
}
|
||||
|
||||
// VerifyTokenSet checks to make sure env is set for the correct scm provider
|
||||
func VerifyTokenSet() error {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user