MCPcopy Create free account
hub / github.com/cli/cli / authHelp

Function authHelp

pkg/cmd/root/help.go:225–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223}
224
225func authHelp() string {
226 if os.Getenv("GITHUB_ACTIONS") == "true" {
227 return heredoc.Doc(`
228 gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. Example:
229 env:
230 GH_TOKEN: ${{ github.token }}
231 `)
232 }
233
234 if os.Getenv("CI") != "" {
235 return heredoc.Doc(`
236 gh: To use GitHub CLI in automation, set the GH_TOKEN environment variable.
237 `)
238 }
239
240 return heredoc.Doc(`
241 To get started with GitHub CLI, please run: gh auth login
242 Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
243 `)
244}
245
246func findCommand(cmd *cobra.Command, name string) *cobra.Command {
247 for _, c := range cmd.Commands() {

Callers 1

NewCmdRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected