-
Couldn't load subscription status.
- Fork 562
fix: fix terragrunt non-interactive flag #2332
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
base: develop
Are you sure you want to change the base?
Conversation
|
Actually @sidpalas I just realised that this would be a breaking change for people who set terragrunt version explicitly to anything older than v0.77.2 Spoke with @motatoes and he suggested setting equivalent env vars ( |
Yeah that makes sense as a way to avoid the breaking change. It would be nice to land #2287 before making that change to avoid triplicating the env vars... Alternatively,
Actually that third option may be the best since it doesn't need to be configurable and doesn't need to be exposed to the end users of the action. |
@sidpalas yes that would be my preference indeed, setting it at the go code level, there is an envs map in the same function where we can set it so it is exposed directly to the terragrunt process, should be a 2-liner change! |
Looks like they are already set! So we just need to remove the hardcoded cli flag |
|
@sidpalas oh nice, yeah its a 1 liner then haha |
| func (terragrunt Terragrunt) Apply(params []string, plan *string, envs map[string]string) (string, string, error) { | ||
| params = append(params, []string{"-lock-timeout=3m"}...) | ||
| params = append(params, "--auto-approve") | ||
| params = append(params, "--terragrunt-non-interactive") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicative with ENV var set here:
digger/libs/execution/terragrunt.go
Lines 123 to 125 in 53173e5
| env = append(env, "TERRAGRUNT_NON_INTERACTIVE=true") | |
| env = append(env, "TG_NO_COLOR=true") | |
| env = append(env, "TG_NON_INTERACTIVE=true") |
By removing the CLI flag but setting both TERRAGRUNT_NON_INTERACTIVE=true AND TG_NON_INTERACTIVE=true this remains compatible with versions before and after the CLI redesign https://terragrunt.gruntwork.io/docs/migrate/cli-redesign/
|
Updated to remove the CLI flag in favor of the environment variables (which were already being set) |
Terragrunt redesigned their CLI (released in v0.77.22, see GH issue comment) to remove the
terragruntprefix.This PR removes the
--terragrunt-non-interactiveforapplyanddestroycommands. This flag is not valid for newer versions of Terragrunt and was duplicative with ENV vars set here:digger/libs/execution/terragrunt.go
Lines 123 to 125 in 53173e5
By removing the CLI flag but setting both
TERRAGRUNT_NON_INTERACTIVE=trueANDTG_NON_INTERACTIVE=true, digger remains compatible with versions before and after the CLI redesign https://terragrunt.gruntwork.io/docs/migrate/cli-redesign/🧠 AI Assistance Disclosure Policy
Important
Inspired by ghostty.
If you used any AI assistance while contributing to Digger, you must disclose it in this PR.
✅ AI Disclosure Checklist
Details (if applicable):
💡 Notes