From 6c24367c7b2717cf52ec7f59e94d27829d91cc7b Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Wed, 20 Apr 2022 09:04:58 -0700 Subject: [PATCH] dumb issue (#2810) --- lib/functions/buildFileList.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/functions/buildFileList.sh b/lib/functions/buildFileList.sh index b4d4bed6..a92b4079 100755 --- a/lib/functions/buildFileList.sh +++ b/lib/functions/buildFileList.sh @@ -70,6 +70,11 @@ function BuildFileList() { debug "VALIDATE_JSCPD_ALL_CODEBASE: ${VALIDATE_JSCPD_ALL_CODEBASE}" + # Solve issue with git unsafe dirs + debug "Running git config for safe dirs" + git config --global --add safe.directory "${GITHUB_WORKSPACE}" 2>&1 + git config --global --add safe.directory "/tmp/lint" 2>&1 + if [ "${VALIDATE_ALL_CODEBASE}" == "false" ] && [ "${TEST_CASE_RUN}" != "true" ]; then # Need to build a list of all files changed # This can be pulled from the GITHUB_EVENT_PATH payload @@ -84,8 +89,6 @@ function BuildFileList() { # Switch codebase back to the default branch to get a list of all files changed # ################################################################################# SWITCH_CMD=$( - git config --global --add safe.directory "${GITHUB_WORKSPACE}" - git config --global --add safe.directory "/tmp/lint" git -C "${GITHUB_WORKSPACE}" pull --quiet git -C "${GITHUB_WORKSPACE}" checkout "${DEFAULT_BRANCH}" 2>&1 )