Skip to content

Commit

Permalink
Fix for #191 (#192)
Browse files Browse the repository at this point in the history
* replace git diff with git diff-tree

* Update entrypoint.sh
  • Loading branch information
georgepstaylor authored Mar 6, 2023
1 parent 3a0fb72 commit 4d1a3b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion terraform-static-analysis/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ declare -i checkov_exitcode=0
declare -i tflint_exitcode=0
declare -i tfinit_exitcode=0

# see https://github.com/actions/runner/issues/2033
git config --global --add safe.directory /github/workspace

# Identify which Terraform folders have changes and need scanning
tf_folders_with_changes=`git diff --no-commit-id --name-only -r @^ | awk '{print $1}' | grep '\.tf' | sed 's#/[^/]*$##' | grep -v '\.tf' | uniq`
tf_folders_with_changes=`git diff-tree --no-commit-id --name-only -r @^ | awk '{print $1}' | grep '\.tf' | sed 's#/[^/]*$##' | grep -v '\.tf' | uniq`
echo
echo "TF folders with changes"
echo $tf_folders_with_changes
Expand Down

0 comments on commit 4d1a3b1

Please sign in to comment.