MCPcopy Create free account
hub / github.com/github/gh-aw / IsRunningInCI

Function IsRunningInCI

pkg/cli/ci.go:12–28  ·  view source on GitHub ↗

IsRunningInCI checks if we're running in a CI environment

()

Source from the content-addressed store, hash-verified

10
11// IsRunningInCI checks if we're running in a CI environment
12func IsRunningInCI() bool {
13 // Common CI environment variables
14 ciVars := []string{
15 "CI",
16 "CONTINUOUS_INTEGRATION",
17 "GITHUB_ACTIONS",
18 }
19
20 for _, v := range ciVars {
21 if os.Getenv(v) != "" {
22 ciLog.Printf("CI environment detected via %s", v)
23 return true
24 }
25 }
26 ciLog.Print("No CI environment detected")
27 return false
28}

Callers 10

main.goFile · 0.92
RunWorkflowInteractivelyFunction · 0.85
downloadArtifactsByNameFunction · 0.85
downloadRunArtifactsFunction · 0.85
shouldCheckForUpdateFunction · 0.85
TestIsRunningInCIFunction · 0.85

Calls 3

GetenvMethod · 0.80
PrintMethod · 0.80
PrintfMethod · 0.45

Tested by 2

TestIsRunningInCIFunction · 0.68