Skip to content

Instantly share code, notes, and snippets.

@hakuno
Created October 30, 2023 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakuno/bdcca79a0d4f23dcfd6f0708dfe6c671 to your computer and use it in GitHub Desktop.
Save hakuno/bdcca79a0d4f23dcfd6f0708dfe6c671 to your computer and use it in GitHub Desktop.
Detect which Terraform modules have changes at commit
git diff --name-only {{ circle_branch.stdout }} | \
xargs -n1 dirname | \
sort | \
uniq | \
xargs -I{} find ../../{} -maxdepth 1 -type f -name 'main.tf' ! -path '*.terraform*' | \
xargs -n1 dirname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment