From f2725fc456deba7922c4aa673e8b6cc33e4b981e Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 16 May 2022 08:52:39 -0400 Subject: [PATCH] Pre-release selftests: set git repo directory as safe This workflow is currently failing, giving the following error: fatal: unsafe repository ('/__w/avocado/avocado' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /__w/avocado/avocado Error: Process completed with exit code 128. Let's work around this limitation and more recent git behavior and set the safe mode on the repo directory manually. Reference: https://github.com/actions/checkout/pull/762 Signed-off-by: Cleber Rosa --- .github/workflows/prerelease.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 5be8a8d5c6..fb6bba272f 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -76,6 +76,7 @@ jobs: run: | VERSION=$(python3 setup.py --version 2>/dev/null) RPM_RELEASE_NUMBER=$(grep -E '^Release:\s([0-9]+)' python-avocado.spec | sed -E 's/Release:\s([0-9]+).*/\1/') + git config --global --add safe.directory `pwd` COMMIT_DATE=$(git log -n 1 --pretty='format:%cd' --date='format:%Y%m%d') SHORT_COMMIT=$(git rev-parse --short=9 master) dnf -y install python3-avocado-${VERSION}-${RPM_RELEASE_NUMBER}.${COMMIT_DATE}git${SHORT_COMMIT}.fc${{env.FEDORA_VERSION}}