Skip to content

Commit 400e956

Browse files
authored
chore: Replaces vars.TF_VERSION_LATEST (#3221)
* remove references to vars.TF_VERSION_LATEST * TEMPORARY: simulate new TF version to test changes * Revert "TEMPORARY: simulate new TF version to test changes" This reverts commit 00831bb.
1 parent 3ad8496 commit 400e956

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.github/workflows/acceptance-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797

9898

9999
with:
100-
terraform_version: ${{ inputs.terraform_version || vars.TF_VERSION_LATEST }}
100+
terraform_version: ${{ inputs.terraform_version || '1.11.x' }}
101101
provider_version: ${{ inputs.provider_version }}
102102
ref: ${{ inputs.ref }}
103103
test_group: ${{ inputs.test_group }}

.github/workflows/examples.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
go-version-file: 'go.mod'
2424
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
2525
with:
26-
terraform_version: ${{ vars.TF_VERSION_LATEST }}
26+
terraform_version: '1.11.x'
2727
terraform_wrapper: false
2828
- name: tf-validate
2929
run: make tools tf-validate

.github/workflows/update-tf-versions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
commit-message: "doc: Updates Terraform Compatibility Matrix documentation"
2727
delete-branch: true
2828
branch: terraform-compatibility-matrix-update
29-
body: "Automatic updates for Terraform Compatibility Matrix documentation. **Action Required**: Update TF_VERSION_LATEST GitHub environment variable if needed."
29+
body: "Automatic updates for Terraform Compatibility Matrix documentation."
3030

3131
update-tf-version-in-repository:
3232
runs-on: ubuntu-latest

scripts/update-tf-version-in-repository.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ set -euo pipefail
1919
TF_VERSIONS_ARR=$(./scripts/get-terraform-supported-versions.sh "false")
2020

2121
TEST_SUITE_YAML_FILE=".github/workflows/test-suite.yml"
22+
ACCEPTANCE_TESTS_YAML_FILE=".github/workflows/acceptance-tests.yml"
23+
EXAMPLES_YAML_FILE=".github/workflows/examples.yml"
2224
TOOL_VERSIONS_FILE=".tool-versions"
2325
DOC_SCRIPT="scripts/generate-doc.sh"
2426
DOC_ALL_SCRIPT="scripts/generate-docs-all.sh"
@@ -27,14 +29,20 @@ LATEST_TF_VERSION=$(echo "$TF_VERSIONS_ARR" | sed -E 's/^\["([^"]+).*/\1/')
2729

2830
# Update Terraform versions in test-suite.yml
2931
sed -i.bak -E "/^ *terraform_matrix:/,/^ *provider_matrix:/ s|(default: ')[^']*(')|\1$TF_VERSIONS_ARR\2|" "$TEST_SUITE_YAML_FILE"
30-
3132
sed -i.bak -E "s|schedule_terraform_matrix: '.*'|schedule_terraform_matrix: '[\"$LATEST_TF_VERSION\"]'|" "$TEST_SUITE_YAML_FILE"
3233

34+
# Update Terraform version in examples.yml
35+
sed -i.bak -E "s|terraform_version: '.*'|terraform_version: '$LATEST_TF_VERSION'|" "$EXAMPLES_YAML_FILE"
36+
37+
# Update Terraform version in acceptance-tests.yml
38+
sed -i.bak -E "s~terraform_version \|\| '[0-9]+\.[0-9]+\.x'~terraform_version \|\| '$LATEST_TF_VERSION'~" "$ACCEPTANCE_TESTS_YAML_FILE"
39+
3340
# Update patch version occurrences
3441
LATEST_TF_PATCH_VERSION=$(./scripts/get-terraform-supported-versions.sh "latest")
3542

3643
# Update Terraform versions in .tool-versions
3744
sed -i.bak -E "s|^(terraform) [0-9]+\.[0-9]+\.[0-9]+|\1 $LATEST_TF_PATCH_VERSION|" "$TOOL_VERSIONS_FILE"
45+
3846
# Update Terraform versions in generate-doc scripts
3947
sed -i.bak -E "/TF_VERSION=/ s/[0-9]+\.[0-9]+\.[0-9]+/$LATEST_TF_PATCH_VERSION/g" "$DOC_SCRIPT"
4048
sed -i.bak -E "/TF_VERSION=/ s/[0-9]+\.[0-9]+\.[0-9]+/$LATEST_TF_PATCH_VERSION/g" "$DOC_ALL_SCRIPT"

0 commit comments

Comments
 (0)