| 208 | } |
| 209 | |
| 210 | func authHelp() string { |
| 211 | if os.Getenv("GITHUB_ACTIONS") == "true" { |
| 212 | return heredoc.Doc(` |
| 213 | gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. Example: |
| 214 | env: |
| 215 | GH_TOKEN: ${{ github.token }} |
| 216 | `) |
| 217 | } |
| 218 | |
| 219 | if os.Getenv("CI") != "" { |
| 220 | return heredoc.Doc(` |
| 221 | gh: To use GitHub CLI in automation, set the GH_TOKEN environment variable. |
| 222 | `) |
| 223 | } |
| 224 | |
| 225 | return heredoc.Doc(` |
| 226 | To get started with GitHub CLI, please run: gh auth login |
| 227 | Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token. |
| 228 | `) |
| 229 | } |
| 230 | |
| 231 | func findCommand(cmd *cobra.Command, name string) *cobra.Command { |
| 232 | for _, c := range cmd.Commands() { |