From cc6054cacf4f99e7ab2f5292d2c674695c5948a9 Mon Sep 17 00:00:00 2001 From: Tomasz Gorochowik Date: Wed, 22 Mar 2023 09:37:49 +0100 Subject: [PATCH] Fix git error in container Otherwise we see the following when running in a container: fatal: detected dubious ownership in repository at '/github/workspace' To add an exception for this directory, call: --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 40d3a83..1ad1e37 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,9 @@ event_file=event.json diff_cmd="git diff FECH_HEAD" +# XXX: workaround for "fatal: detected dubious ownership in repository" when running in a container +git config --global --add safe.directory '*' + if [ -f "$event_file" ]; then pr_branch=$(python3 -c "import sys, json; print(json.load(sys.stdin)['pull_request']['head']['ref'])" < event.json) base_branch=$(python3 -c "import sys, json; print(json.load(sys.stdin)['pull_request']['base']['ref'])" < event.json)