From bbdb0774ed91d9ab2427efe0f7e5bea0e44e69af Mon Sep 17 00:00:00 2001 From: Sam V Date: Wed, 15 Jun 2022 18:45:25 +0200 Subject: [PATCH] Mark all directories as safe so CI builds don't fail with "unsafe repository" errors --- .github/build.sh | 4 ++++ .github/workflows/build.yml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/.github/build.sh b/.github/build.sh index 29be1c4..543a1de 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -57,6 +57,10 @@ has_clang || has_gcc || die "No compiler available" export CCACHE_DIR=$PWD/build-ci-ccache ccache -M4G +# Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors. +# See https://github.com/actions/checkout/issues/766 +git config --global --add safe.directory '*' + # Use shallow clones of submodules for space/time efficiency. #git submodule update --init --depth=1 2>&1 | cat diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e397c11..0944f07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,6 +55,11 @@ jobs: cd build cmake -S .. -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON + # Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors. + # See https://github.com/actions/checkout/issues/766 + - name: Configure Git + run: git config --global --add safe.directory '*' + - name: Build projects working-directory: '${{ github.workspace }}/build' run: ninja