atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

Support `CI` and `ATLANTIS` native environment variables

Open ponkio-o opened this issue 3 weeks ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the user story

When executing tools or scripts in Custom Workflow, there are situations where you may want to confirm that they are “running in Atlantis.”

For example, other CI services provide environment variables such as the following, which can be used to determine the execution environment.

  • CircleCI (docs)
    • CI / CIRCLECI
  • GitHub Actions (docs)
    • CI / GITHUB_ACTION
  • Drone (docs)
    • CI / DRONE

However, it does not exist in Atlantis. https://www.runatlantis.io/docs/custom-workflows#native-environment-variables

The github-comment tool identifies the execution environment based on these environment variables. https://suzuki-shunsuke.github.io/github-comment/complement

Describe the solution you'd like

This can be resolved by providing the environment variables CI=true and ATLANTIS=true as Native Environment Variables. https://www.runatlantis.io/docs/custom-workflows#native-environment-variables

Describe the drawbacks of your solution

Currently, we are using ATLANTIS_TERRAFORM_VERSION for determination, but I don't think it's very appropriate. Because this variable is intended to store the Terraform version.

Describe alternatives you've considered

related issue: https://github.com/suzuki-shunsuke/go-ci-env/issues/583#issuecomment-3585492611

ponkio-o avatar Nov 28 '25 07:11 ponkio-o