Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add repository path to Git safe.directory
Required because the owner inside containers is different, likely root,
and git doesn't allow that by default.
  • Loading branch information
Flamefire committed Feb 15, 2025
commit 4555a8d0d969d78af69e0de59d8d9a1f4423b60a
8 changes: 6 additions & 2 deletions ci/github/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2021 Alexander Grund
# Copyright 2021-2025 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -13,6 +13,10 @@

set -ex

# Required because inside a container the owner is root so git commands would fail.
# Note that $GITHUB_WORKSPACE != ${{github.workspace}} (in the CI yml) inside containers.
git config --global --add safe.directory "$GITHUB_WORKSPACE" || echo "Failed to set Git safe.directory" # Don't fail, just warn

BOOST_CI_TARGET_BRANCH="${GITHUB_BASE_REF:-$GITHUB_REF}"
export BOOST_CI_TARGET_BRANCH="${BOOST_CI_TARGET_BRANCH##*/}" # Extract branch name
export BOOST_CI_SRC_FOLDER="${GITHUB_WORKSPACE//\\//}"
Expand Down Expand Up @@ -64,4 +68,4 @@ fi
[ -z "$B2_TARGETS" ] || echo "B2_TARGETS=$B2_TARGETS"
# Filter out (only) the conditions from set -x
# Write the stdout to the GitHub env file
} 2> >(grep -vF ' -z ' >&2) >> "$GITHUB_ENV"
} 2> >(grep -vF ' -z ' >&2) >> "$GITHUB_ENV"
Loading