From b4417a91f1b589b2542238eb44e5b3c08677d5da Mon Sep 17 00:00:00 2001 From: Eugene Kolnick <34349331+eak12913@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:05:23 -0400 Subject: [PATCH] Fix folder permissions issue This fix addresses an issue where terragrunt throws an issue when calling functions like `get_repo_root` which uses `git rev-parse` under the hood and gets a permissions error like: ``` git rev-parse --show-toplevel fatal: detected dubious ownership in repository at '/github/workspace/infrastructure-live' To add an exception for this directory, call: git config --global --add safe.directory /github/workspace/infrastructure-live ``` --- src/main.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.sh b/src/main.sh index c5a5250..e1af0ee 100755 --- a/src/main.sh +++ b/src/main.sh @@ -82,6 +82,8 @@ function comment { function setup_git { # Avoid git permissions warnings git config --global --add safe.directory /github/workspace + # Also trust any subfolder within workspace + git config --global --add safe.directory /github/workspace/* } # Run INPUT_PRE_EXEC_* environment variables as Bash code