cibuild.go 474 B

1234567891011121314
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Package cibuild reports runtime CI information.
  4. package cibuild
  5. import "os"
  6. // On reports whether the current binary is executing on a CI system.
  7. func On() bool {
  8. // CI env variable is set by GitHub.
  9. // https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
  10. return os.Getenv("GITHUB_ACTIONS") != "" || os.Getenv("CI") == "true"
  11. }