You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this setup to run on a list of directories some of which will have terraform version files I want to use to set the terraform version.
I'm not asking for .terraform-version support I just want to know how I can add this manually.
I also want to use the terraform wrapper to get the output in the PR but I can't figure out how to tell the wrapper what terraform version to use.
Its going to be different for every folder so I can't statically set with.terraform_version from the output of a previous job or anything. I need to set it inside of the job with hashicorp/setup-terraform.
How is this possible? I tried setting this env var I saw in the code to tfenv: export TERRAFORM_CLI_PATH="$HOME/.tfenv/bin" but that doesn't work.
I want to use the terraform wrapper of this workflow not a raw tf exe so I can get the nice output.
The text was updated successfully, but these errors were encountered:
Never mind I didn't understand how gh actions worked
I was able to define an output in the job and pass it to the workflow
- name: Set Version
id: tf_version
run: |
# Script reads version files and sets github output like this: echo "tf_version=$TF_VERSION" >> "$GITHUB_OUTPUT"
my_script.sh
- uses: hashicorp/setup-terraform@v2
with:
# Use output set in previous step as input to the workflow
terraform_version: ${{ steps.tf_version.outputs.tf_version }}
I have this setup to run on a list of directories some of which will have terraform version files I want to use to set the terraform version.
I'm not asking for
.terraform-version
support I just want to know how I can add this manually.I also want to use the terraform wrapper to get the output in the PR but I can't figure out how to tell the wrapper what terraform version to use.
Its going to be different for every folder so I can't statically set with.terraform_version from the output of a previous job or anything. I need to set it inside of the job with
hashicorp/setup-terraform
.How is this possible? I tried setting this env var I saw in the code to tfenv:
export TERRAFORM_CLI_PATH="$HOME/.tfenv/bin"
but that doesn't work.I want to use the terraform wrapper of this workflow not a raw tf exe so I can get the nice output.
The text was updated successfully, but these errors were encountered: