Repository navigation
fix: add tool-cache-dir so terraform and terragrunt binaries are reused between runs - #2772
Open
s1ntaxe770r wants to merge 1 commit into
Open
s1ntaxe770r wants to merge 1 commit into
s1ntaxe770r wants to merge 1 commit into
Conversation
…retry downloads Setup Terragrunt downloaded into RUNNER_TEMP on every run with a single curl, so a connection reset from github.com failed the whole job, and hashicorp/setup-terraform did the same against releases.hashicorp.com. Both are now bash steps that store the binary under tool-cache-dir (default RUNNER_TOOL_CACHE) as <tool>/<version>/<arch>, skip the download when a working binary is already there, and retry the curl.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
opentaco-docs | c71593a | Commit Preview URL Branch Preview URL |
Nov 19 2026, 08:40 AM |
This branch has not been deployed
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.
The action downloaded terraform (via
hashicorp/setup-terraform) and terragrunt into a per-job temp directory on every run, with a singlecurland no retry. There was no way to point the action at a directory where these binaries could be kept between runs, so on self-hosted runners every job re-downloaded them, and one transient network error fromgithub.comorreleases.hashicorp.comfailed the whole job.This PR adds a
tool-cache-dirinput. Both setup steps now store the binary at<tool-cache-dir>/<tool>/<version>/<arch>/, reuse it when a working binary is already there, and retry the download when it is not. The default is the runner's own tool cache ($RUNNER_TOOL_CACHE), so GitHub-hosted runners behave as before; on self-hosted runners you point it at a persistent volume, the same wayterraform-cache-diralready works for providers.Notes:
hashicorp/setup-terraformis replaced with a bash step (we already ran it withterraform_wrapper: false). It resolveslatest, downloads the zip, and writes the TFE credentials block to the CLI config file as before.terraform-versionnow accepts an exact version orlatest; semver ranges such as~1.5are no longer accepted.<tool-cache-dir>/<tool>/<version>by hand.Docs:
docs/ce/howto/caching-strategies.mdx, new section "Cache the Terraform and Terragrunt binaries" (will publish at https://docs.digger.dev/ce/howto/caching-strategies)docs/ce/reference/action-inputs.mdx,tool-cache-diradded, along with the previously missingterraform-cache-dir(https://docs.digger.dev/ce/reference/action-inputs)Testing
End to end on https://github.com/s1ntaxe770r/terragrun-test with the action used three times in one job against the same
tool-cache-dir: https://github.com/s1ntaxe770r/terragrun-test/actions/runs/44488381461Using cached Terraform 1.5.5 from .../terraform/1.5.5/amd64/terraform, cache dir unchangedUsing cached Terragrunt v1.1.2 from .../terragrunt/1.1.2/amd64/terragrunt, cache dir unchangedAlso ran each step's script locally for the
latest, rejected-range and TFE credentials cases.🧠 Ai UsageDetails (if applicable):
Fix, docs and e2e workflow drafted with Claude Code; reviewed manually and verified in the test repo linked above.