GetGitHubToken returns the GitHub token from the environment and the name of the variable it was found in.
()
| 134 | |
| 135 | // GetGitHubToken returns the GitHub token from the environment and the name of the variable it was found in. |
| 136 | func GetGitHubToken() (string, string) { |
| 137 | for _, token := range []string{"DDEV_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"} { |
| 138 | if githubToken := os.Getenv(token); githubToken != "" { |
| 139 | return githubToken, token |
| 140 | } |
| 141 | } |
| 142 | return "", "" |
| 143 | } |
| 144 | |
| 145 | // HasGitHubToken returns true if a GitHub token is set in the environment. |
| 146 | func HasGitHubToken() bool { |
no outgoing calls