Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .terraform-version file #298

Open
lukasz-mitka opened this issue Feb 3, 2023 · 5 comments
Open

Add support for .terraform-version file #298

lukasz-mitka opened this issue Feb 3, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@lukasz-mitka
Copy link

Same way actions/setup-node or actions/setup-python handle setting version from a file.
It could default to .terraform-version file as tfenv already uses it: https://github.com/tfutils/tfenv#terraform-version-file and matches pattern for other actions.

@gunta
Copy link

gunta commented Feb 16, 2023

Something like this logic would work perfect
https://github.com/actions/setup-node/blob/ae9f0f7448e93b1be0f44663e79763dbdffcc4da/src/main.ts#L80

@Crisfole
Copy link

  - name: Get Terraform Version
    id: tf_version
    run: |
      echo "value=$(cat .terraform-version)" >> $GITHUB_OUTPUT

Then later you can ${{ steps.env_name.outputs.value }}

@lukasz-mitka
Copy link
Author

@Crisfole this is a good workaround, but the idea is to have built-in solution like other actions have (https://github.com/actions/setup-node or https://github.com/actions/setup-python)

Also please fix your snippet. It should be ${{ steps.tf_version.outputs.value }}

@pioneer2k
Copy link

There are other tools on the market that uses this mechanism, like Mend Renovate for creating automated pull requests for dependency updates: https://docs.renovatebot.com/modules/manager/terraform-version/

@Crisfole
Copy link

@Crisfole this is a good workaround, but the idea is to have built-in solution like other actions have

Oh, for sure! But two years from now when I Google this again I want to have that comment available to me! 😆

@bflad bflad self-assigned this Nov 29, 2023
@bflad bflad added the enhancement New feature or request label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants