Skip to content

Support CI and ATLANTIS native environment variables #5985

@ponkio-o

Description

@ponkio-o

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: suzuki-shunsuke/go-ci-env#583 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality/enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions