Skip to content

Conversation

@sidpalas
Copy link
Contributor

@sidpalas sidpalas commented Oct 22, 2025

Terragrunt redesigned their CLI (released in v0.77.22, see GH issue comment) to remove the terragrunt prefix.

This PR removes the --terragrunt-non-interactive for apply and destroy commands. This flag is not valid for newer versions of Terragrunt and was duplicative with ENV vars set here:

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, 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

  • I understand that all AI assistance must be disclosed.
  • I did not use AI tools in this contribution.
  • I used AI tools and have disclosed details below.

Details (if applicable):

Example: Used ChatGPT to help with doc phrasing.
Example: Code generated by Copilot; reviewed and verified manually.


💡 Notes

  • Trivial auto-completions (single words, short phrases) don’t need disclosure.
  • Contributors must understand and take responsibility for any AI-assisted code.
  • Failure to disclose is considered disrespectful to maintainers and may delay review.

@ZIJ
Copy link
Contributor

ZIJ commented Oct 22, 2025

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 (TG_NON_INTERACTIVE and older equivalent TERRAGRUNT_NON_INTERACTIVE) - this way we would not have to do a conditional check of the actual terragrunt version

@sidpalas
Copy link
Contributor Author

sidpalas commented Oct 22, 2025

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 (TG_NON_INTERACTIVE and older equivalent TERRAGRUNT_NON_INTERACTIVE) - this way we would not have to do a conditional check of the actual terragrunt version

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,

  • the env var could be set that the job level (even though it is only needed at the step where digger is executed)
  • the env var could be set within the go code

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.

@motatoes
Copy link
Contributor

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!

@sidpalas
Copy link
Contributor Author

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!

https://github.com/sidpalas/digger/blob/sp/fix-terragrunt-flags/libs/execution/terragrunt.go#L122-L125

So we just need to remove the hardcoded cli flag

@motatoes
Copy link
Contributor

@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")
Copy link
Contributor Author

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:

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/

@sidpalas
Copy link
Contributor Author

Updated to remove the CLI flag in favor of the environment variables (which were already being set)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants