fix(terragrunt_providers_lock): Use the updated Terragrunt CLI arguments#940
fix(terragrunt_providers_lock): Use the updated Terragrunt CLI arguments#940yupyvovarov wants to merge 3 commits intoantonbabenko:masterfrom
Conversation
Due to an error: ``` ERROR The `providers` command is no longer supported. Use `terragrunt run -- providers` instead. ```
for more information, see https://pre-commit.ci
📝 WalkthroughSummary by CodeRabbit
WalkthroughDetect Terragrunt version and choose subcommand form: for Terragrunt >= 0.78 use Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant Hook as terragrunt_providers_lock.sh
participant TG as Terragrunt CLI
Dev->>Hook: Execute hook
Hook->>TG: terragrunt --version
TG-->>Hook: Version string
alt Version >= 0.78
Hook->>TG: terragrunt run -- providers lock (via SUBCOMMAND)
else Version < 0.78
Hook->>TG: terragrunt providers lock (via SUBCOMMAND)
end
TG-->>Hook: Exit code
Hook-->>Dev: Propagate exit code
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
hooks/terragrunt_providers_lock.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: jannis-a
PR: antonbabenko/pre-commit-terraform#933
File: hooks/terragrunt_providers_lock.sh:18-21
Timestamp: 2025-09-13T19:34:00.317Z
Learning: In terragrunt hooks, the `--` separator should only be added before Terraform commands that are invoked through Terragrunt (like `providers lock`, `validate`), but not before native Terragrunt commands (like `hcl validate`). The separator tells Terragrunt to pass subsequent arguments to the underlying Terraform command, which is not applicable for Terragrunt's own commands.
📚 Learning: 2025-09-13T19:34:00.317Z
Learnt from: jannis-a
PR: antonbabenko/pre-commit-terraform#933
File: hooks/terragrunt_providers_lock.sh:18-21
Timestamp: 2025-09-13T19:34:00.317Z
Learning: In terragrunt hooks, the `--` separator should only be added before Terraform commands that are invoked through Terragrunt (like `providers lock`, `validate`), but not before native Terragrunt commands (like `hcl validate`). The separator tells Terragrunt to pass subsequent arguments to the underlying Terraform command, which is not applicable for Terragrunt's own commands.
Applied to files:
hooks/terragrunt_providers_lock.sh
🧬 Code graph analysis (1)
hooks/terragrunt_providers_lock.sh (1)
hooks/_common.sh (1)
common::terragrunt_version_ge_0.78(622-639)
|
@yupyvovarov Thank you for the contribution. This is already being worked on in scope of #939 though. |
Due to an error:
Put an
xinto the box if that apply:Description of your changes
When the hook was running, it failed

How can we test changes
When it fixed:
