Skip to content

Commit 94ad89b

Browse files
authored
Merge pull request #47 from rtCamp/fix/submodule-perms
Add individual submodule path as safe
2 parents a955d7a + 826a70f commit 94ad89b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ function maybe_install_submodules() {
143143
# Change directory ownership to container user due to issue https://github.com/actions/checkout/issues/760
144144
# This will be changed to www-data or similar on deployment by deployer.
145145
git config --global --add safe.directory "$GITHUB_WORKSPACE"
146+
submodule_paths=$(grep path .gitmodules | awk '{print $3}')
147+
for path in $submodule_paths; do
148+
git config --global --add safe.directory "$GITHUB_WORKSPACE/$path"
149+
done
146150

147151
# add github's public key
148152
curl -sL https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >>/etc/ssh/known_hosts

0 commit comments

Comments
 (0)