Skip to content

Commit

Permalink
Fix folder permissions issue
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
eak12913 authored Aug 1, 2023
1 parent 3c1c347 commit b4417a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b4417a9

Please sign in to comment.