IsCI determines if the current execution context is within a known CI/CD system. This is based on https://github.com/watson/ci-info/blob/HEAD/index.js.
()
| 6 | // IsCI determines if the current execution context is within a known CI/CD system. |
| 7 | // This is based on https://github.com/watson/ci-info/blob/HEAD/index.js. |
| 8 | func IsCI() bool { |
| 9 | return os.Getenv("CI") != "" || // GitHub Actions, Travis CI, CircleCI, Cirrus CI, GitLab CI, AppVeyor, CodeShip, dsari |
| 10 | os.Getenv("BUILD_NUMBER") != "" || // Jenkins, TeamCity |
| 11 | os.Getenv("RUN_ID") != "" // TaskCluster, dsari |
| 12 | } |
| 13 | |
| 14 | // IsGitHubActions determines if the current execution context is within GitHub Actions. |
| 15 | // GitHub Actions sets the GITHUB_ACTIONS environment variable to "true" for all steps. |
no outgoing calls