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

Function IsGitHubActions

internal/ci/ci.go:17–19  ·  view source on GitHub ↗

IsGitHubActions determines if the current execution context is within GitHub Actions. GitHub Actions sets the GITHUB_ACTIONS environment variable to "true" for all steps. See https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables.

()

Source from the content-addressed store, hash-verified

15// GitHub Actions sets the GITHUB_ACTIONS environment variable to "true" for all steps.
16// See https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables.
17func IsGitHubActions() bool {
18 return os.Getenv("GITHUB_ACTIONS") == "true"
19}

Callers 2

MainFunction · 0.92
TestIsGitHubActionsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsGitHubActionsFunction · 0.68