You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue when trying to detect modified .hcl files using a pre-workflow hook in Atlantis, particularly when leveraging the terragrunt-atlantis-config tool.
Problem:
I have a scenario where I need to list only the .hcl files that were modified in the most recent commit to ensure that Atlantis plans and applies the correct infrastructure changes. However, when I use the git show --name-only --pretty="" $HEAD_COMMIT | grep '\.hcl$' command in the pre-workflow hook, it lists all .hcl files in the commit, not just those that were modified.
Description:
I'm encountering an issue when trying to detect modified .hcl files using a pre-workflow hook in Atlantis, particularly when leveraging the terragrunt-atlantis-config tool.
Problem:
I have a scenario where I need to list only the .hcl files that were modified in the most recent commit to ensure that Atlantis plans and applies the correct infrastructure changes. However, when I use the
git show --name-only --pretty="" $HEAD_COMMIT | grep '\.hcl$'
command in the pre-workflow hook, it lists all .hcl files in the commit, not just those that were modified.Eventhough, there is modification to *.hcl file, terragrunt plan is not executing as per repos.yaml
atlantis.yaml generated:
autoplan:
enabled: true
when_modified:
dir: regions/westeurope/demo/argocd
workflow: terragrunt
My directory structure:
infra/terragrunt/regions/westeurope/demo/argocd/terragrunt.hcl
terraform {
source = "${get_repo_root()}/terraform//modules/argocd-module/"
}
infra/terraform/modules/argocd-module/main.tf
module "argocd" {
source = "../../sub-modules/argocd"
}
Expected Behavior:
Error:
msg=open /atlantis-data/repos/devops1/infra/353/default/terraform/sub-modules/argocd/terragrunt.hcl: no such file or directory
but actually, the *.hcl is not under sub-modules/argocd/
Actual Behavior:
All .hcl files in the commit are listed, regardless of whether they were modified.
Environment:
Atlantis App version: v0.28.3
Atlantis Helm chart version: atlantis-5.3.0
terragrunt-atlantis-config version: 1.18.0
Terraform version: v1.5.7
Terragrunt version: v0.57.1
The text was updated successfully, but these errors were encountered: