Skip to content

Commit bbdb077

Browse files
SamVanheerzpostfacto
authored andcommitted
Mark all directories as safe so CI builds don't fail with "unsafe repository" errors
1 parent 1593fb4 commit bbdb077

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ has_clang || has_gcc || die "No compiler available"
5757
export CCACHE_DIR=$PWD/build-ci-ccache
5858
ccache -M4G
5959

60+
# Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors.
61+
# See https://github.com/actions/checkout/issues/766
62+
git config --global --add safe.directory '*'
63+
6064
# Use shallow clones of submodules for space/time efficiency.
6165
#git submodule update --init --depth=1 2>&1 | cat
6266

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ jobs:
5555
cd build
5656
cmake -S .. -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON
5757
58+
# Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors.
59+
# See https://github.com/actions/checkout/issues/766
60+
- name: Configure Git
61+
run: git config --global --add safe.directory '*'
62+
5863
- name: Build projects
5964
working-directory: '${{ github.workspace }}/build'
6065
run: ninja

0 commit comments

Comments
 (0)