From ae6dc3faeec03bf76ebcc03789b6745ee0bd085a Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Sun, 18 Oct 2026 23:56:15 +0100 Subject: [PATCH] ci: mark the layer checkout safe for git in yocto-check-layer The checkout is owned by the runner user while the container runs as ci, so git refuses to read /work. Mark it as a safe directory, as the DCO check already does. Signed-off-by: Andrei Gherzan --- .../yocto-builder/entrypoint-yocto-check-layer.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docker-images/yocto-builder/entrypoint-yocto-check-layer.sh b/.github/workflows/docker-images/yocto-builder/entrypoint-yocto-check-layer.sh index 55566a9..d11e9fd 100755 --- a/.github/workflows/docker-images/yocto-builder/entrypoint-yocto-check-layer.sh +++ b/.github/workflows/docker-images/yocto-builder/entrypoint-yocto-check-layer.sh @@ -16,6 +16,13 @@ GIT_REPO_PATH="/work" [ -d "$GIT_REPO_PATH/.git" ] || error "Can't find a git checkout under $GIT_REPO_PATH ." +# The GitHub runner user and the container user might differ making git error +# out with: +# error: fatal: detected dubious ownership in repository at '/work' +# Avoid this as the security risk is minimum here while guarding the git hooks +# via PRs. +git config --global --add safe.directory /work + TEMP_DIR="$(mktemp -d)" cd "$TEMP_DIR"