Repository navigation
feat: add a setup-terraform action pinned to an exact version - #26
Merged
Merged
Conversation
Sets up Terraform 1.16.7 and runs terraform init -lockfile=readonly, so that the providers come from the committed lock file only.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the shared Terraform setup action.
No open issues 🎉
What changed in this PR
Adds a shared Terraform setup action to reduce version drift between consuming repositories and initialize providers using the committed lock file.
Changes:
- Defaults to Terraform
1.16.7, with configurable working directory, S3 state bucket, and wrapper behavior. - Runs non-interactive initialization with
-lockfile=readonly. - Adds CI checks for the installed version and rejection of provider configuration without a lock file, plus usage documentation.
| File | Description |
|---|---|
| README.md | Documents action usage, credential setup, lock-file requirements, and version updates. |
| .github/workflows/ci.yml | Checks the Terraform version and missing-lock-file failure. |
| .github/actions/setup-terraform/action.yml | Defines the shared setup action and read-only lock-file initialization. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Shared by motis-mcp-app and amap-en-ligne, which have drifted apart (setup-terraform v4.0.1 / v3.1.2, Terraform
~1.16/~1.11).terraform_versioninput.terraform init -input=false -lockfile=readonly: init fails when.terraform.lock.hcldoes not match the constraints, instead of resolving other provider versions.state-bucketinput for the S3 backend; the credentials stay in the callers, as the roles differ between jobs.