From 605cc0821ac40e5c3d9eafcd68644439e21ebf49 Mon Sep 17 00:00:00 2001 From: Nashwan Azhari Date: Mon, 31 Mar 2025 16:32:31 +0300 Subject: [PATCH] fix: avoid 'dubious ownership' issues with git repo. The `git` command performs some ownership checks on the '.git' directory which may lead to some `git` subcommands used by various build tools (most notably `rev-parse`) refusing to execute. This patch avoids the issue by explicitly marking the entire '$GITHUB_WORKSPACE' path as safe to `git`. Signed-off-by: Nashwan Azhari --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 4bdb6d3..091ad7d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -61,6 +61,9 @@ rmdir "$PROJECT_ROOT" ln -s "$GITHUB_WORKSPACE" "$PROJECT_ROOT" cd "$PROJECT_ROOT" +# Avoid 'dubious ownership' errors from some `git` subcommands: +git config --global safe.directory "$GITHUB_WORKSPACE" + # Run pre-build script if [ -f "$PRE_BUILD" ]; then "./$PRE_BUILD"