diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 267175ef..37deda24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -276,7 +276,6 @@ jobs: name: ${{env.CODECOV_NAME}} token: ${{secrets.CODECOV_TOKEN}} verbose: true - working-directory: ${{github.workspace}} - name: Run coverity if: matrix.coverity && github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name == 'master') @@ -353,7 +352,6 @@ jobs: name: ${{env.CODECOV_NAME}} (Windows) token: ${{secrets.CODECOV_TOKEN}} verbose: true - working-directory: ${{github.workspace}} MSYS2: defaults: diff --git a/ci/github/install.sh b/ci/github/install.sh index a6944026..53379fa0 100644 --- a/ci/github/install.sh +++ b/ci/github/install.sh @@ -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) @@ -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//\\//}" @@ -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" \ No newline at end of file +} 2> >(grep -vF ' -z ' >&2) >> "$GITHUB_ENV"