diff --git a/terraform-static-analysis/entrypoint.sh b/terraform-static-analysis/entrypoint.sh index 186a09cd..2420c996 100755 --- a/terraform-static-analysis/entrypoint.sh +++ b/terraform-static-analysis/entrypoint.sh @@ -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