Workflow failure, `fatal: detected dubious ownership in repository at '/github/workspace/./.git'`
Closed this issue · 4 comments
ralienpp commented
We use the template in the cmp-updates repository and we're experiencing the following error:
Run martinthomson/i-d-template@v1
/usr/bin/docker run --name ghcriomartinthomsonidtemplateactionlatest_d04738 --label bfadfe --workdir /github/workspace --rm -e "INPUT_MAKE" -e "INPUT_TOKEN" -e "GITHUB_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_
make: '.targets.mk' is up to date.
git fetch -qf origin gh-pages:gh-pages
git clone -q -b gh-pages . /tmp/ghpages41
fatal: detected dubious ownership in repository at '/github/workspace/./.git'
To add an exception for this directory, call:
git config --global --add safe.directory /github/workspace/./.git
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
make: *** [lib/ghpages.mk:62: /tmp/ghpages41] Error 128
To the best of my knowledge, nothing was changed in the workflow on our side, and I am not sure where to modify the command as recommended in the error message (--add safe.directory
). Is this a global matter, or a problem specific to our repository?
billwuqin commented
I face similar issues today.
martinthomson commented
Best guess is that something changed in the version of git that is installed. The indicated command already runs with "/github/workspace" as the argument. I've added a workaround, let's try again and see.
ralienpp commented
I ran the job again - it worked this time. Thank you!
billwuqin commented
same here, thanks.