shalzz / zola-deploy-action

Github action for building a Zola site and deploying to Github Pages
MIT License
232 stars 91 forks source link

Fatal error when trying to fetch theme submodules #50

Closed Wtoll closed 1 year ago

Wtoll commented 1 year ago

Relevant Versions

zola-deploy-action version 0.16.1 checkout version 3.3.0

Problem

I keep experiencing the following issue while using the action:

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

    git config --global --add safe.directory /github/workspace

I've traced it to the call in entrypoint.sh to fetch submodule themes.

Looking further it's weird because within checkout there is an option to add the repository directory as a safe directory which is by default set to true, but then somewhere in the process of the action being moved into the docker container the directories change (I've only a basic understanding of how actions work) and thus the permissions get reset.

It's my theory that a fix is as simple as adding a line calling git config --global --add safe.directory /github/workspace before the chunk to update the submodules but again I've not much experience making actions so I'm uncertain.

Wtoll commented 1 year ago

Also see actions/checkout#915 here