|
67 | 67 | ghorgReCloneQuiet bool
|
68 | 68 | ghorgReCloneList bool
|
69 | 69 | ghorgReCloneEnvConfigOnly bool
|
| 70 | + githubTokenFromGithubApp bool |
70 | 71 | noToken bool
|
71 | 72 | quietMode bool
|
72 | 73 | noDirSize bool
|
@@ -217,6 +218,8 @@ func getOrSetDefaults(envVar string) {
|
217 | 218 | os.Setenv(envVar, "0")
|
218 | 219 | case "GHORG_EXIT_CODE_ON_CLONE_ISSUES":
|
219 | 220 | os.Setenv(envVar, "1")
|
| 221 | + case "GHORG_GITHUB_TOKEN_FROM_GITHUB_APP": |
| 222 | + os.Setenv(envVar, "false") |
220 | 223 | }
|
221 | 224 | } else {
|
222 | 225 | s := viper.GetString(envVar)
|
@@ -309,6 +312,7 @@ func InitConfig() {
|
309 | 312 | getOrSetDefaults("GHORG_TARGET_REPOS_PATH")
|
310 | 313 | getOrSetDefaults("GHORG_CLONE_DEPTH")
|
311 | 314 | getOrSetDefaults("GHORG_GITHUB_TOKEN")
|
| 315 | + getOrSetDefaults("GHORG_GITHUB_TOKEN_FROM_GITHUB_APP") |
312 | 316 | getOrSetDefaults("GHORG_GITHUB_FILTER_LANGUAGE")
|
313 | 317 | getOrSetDefaults("GHORG_COLOR")
|
314 | 318 | getOrSetDefaults("GHORG_TOPICS")
|
@@ -396,6 +400,7 @@ func init() {
|
396 | 400 | cloneCmd.Flags().StringVarP(&exitCodeOnCloneInfos, "exit-code-on-clone-infos", "", "", "GHORG_EXIT_CODE_ON_CLONE_INFOS - Allows you to control the exit code when ghorg runs into a problem (info level message) cloning a repo from the remote. Info messages will appear after a clone is complete, similar to success messages. (default 0)")
|
397 | 401 | cloneCmd.Flags().StringVarP(&exitCodeOnCloneIssues, "exit-code-on-clone-issues", "", "", "GHORG_EXIT_CODE_ON_CLONE_ISSUES - Allows you to control the exit code when ghorg runs into a problem (issue level message) cloning a repo from the remote. Issue messages will appear after a clone is complete, similar to success messages (default 1)")
|
398 | 402 | cloneCmd.Flags().StringVarP(&gitFilter, "git-filter", "", "", "GHORG_GIT_FILTER - Allows you to pass arguments to git's filter flag. Useful for filtering out binary objects from repos with --git-filter=blob:none, this requires git version 2.19 or greater.")
|
| 403 | + cloneCmd.Flags().BoolVarP(&githubTokenFromGithubApp, "github-token-from-github-app", "", false, "GHORG_GITHUB_TOKEN_FROM_GITHUB_APP - Indicate that the Github token should be treated as an app token. Needed if you already obtained a github app token outside the context of ghorg.") |
399 | 404 | cloneCmd.Flags().StringVarP(&githubAppPemPath, "github-app-pem-path", "", "", "GHORG_GITHUB_APP_PEM_PATH - Path to your GitHub App PEM file, for authenticating with GitHub App.")
|
400 | 405 | cloneCmd.Flags().StringVarP(&githubAppInstallationID, "github-app-installation-id", "", "", "GHORG_GITHUB_APP_INSTALLATION_ID - GitHub App Installation ID, for authenticating with GitHub App.")
|
401 | 406 | cloneCmd.Flags().StringVarP(&githubFilterLanguage, "github-filter-language", "", "", "GHORG_GITHUB_FILTER_LANGUAGE - Filter repos by a language. Can be a comma separated value with no spaces.")
|
|
0 commit comments