Skip to content

Commit

Permalink
ci/*.sh: add workaround for git dubious ownership
Browse files Browse the repository at this point in the history
Lint and test jobs are failing with
  git config --global --add safe.directory /__w/vdsm/vdsm
  fatal: detected dubious ownership in repository at '/__w/vdsm/vdsm'
  To add an exception for this directory, call:

As suggested in [1], add current directory to the git safe
list to avoid the issue.

[1] actions/runner-images#6775

Signed-off-by: Albert Esteve <aesteve@redhat.com>
  • Loading branch information
aesteve-rh authored and mz-pdm committed Mar 13, 2023
1 parent a7f8557 commit e2aa1df
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
11 changes: 9 additions & 2 deletions ci/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later

# Activate the tests venv (for containers only)
[ -d /venv ] && source /venv/bin/activate
# Only when running in a container
[ -d /venv ] && {
# Workaround to avoid this warning:
# fatal: detected dubious ownership in repository at '/dir'
git config --global --add safe.directory "$(pwd)"

# Activate the tests venv (for containers only)
source /venv/bin/activate
}

./autogen.sh --system
make
Expand Down
11 changes: 9 additions & 2 deletions ci/tests-storage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ if [ -z "$user" ]; then
exit 1
fi

# Activate the tests venv (for containers only)
[ -d /venv ] && source /venv/bin/activate
# Only when running in a container
[ -d /venv ] && {
# Workaround to avoid this warning:
# fatal: detected dubious ownership in repository at '/dir'
git config --global --add safe.directory "$(pwd)"

# Activate the tests venv (for containers only)
source /venv/bin/activate
}

echo "Running tests as user $user"

Expand Down
11 changes: 9 additions & 2 deletions ci/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6
SUFFIX=$RANDOM
ip link add mod_bond$SUFFIX type bond && ip link del mod_bond$SUFFIX

# Activate the tests venv (for containers only)
[ -d /venv ] && source /venv/bin/activate
# Only when running in a container
[ -d /venv ] && {
# Workaround to avoid this warning:
# fatal: detected dubious ownership in repository at '/dir'
git config --global --add safe.directory "$(pwd)"

# Activate the tests venv (for containers only)
source /venv/bin/activate
}

./autogen.sh --system
make
Expand Down

0 comments on commit e2aa1df

Please sign in to comment.