Skip to content

Commit cf0997a

Browse files
authored
Merge pull request #45 from rtCamp/fix/chown-perms
Fix chown perms for self-hosted runner issue
2 parents 6fb8671 + 62bdac7 commit cf0997a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ function setup_ssh_access() {
138138

139139
function maybe_install_submodules() {
140140

141-
# Change directory ownership to container user due to issue https://github.com/actions/checkout/issues/760
142-
# This will be changed to www-data or similar on deployment by deployer.
143-
chown -R root: "$GITHUB_WORKSPACE"
144141
# Check and update submodules if any
145142
if [[ -f "$GITHUB_WORKSPACE/.gitmodules" ]]; then
143+
# Change directory ownership to container user due to issue https://github.com/actions/checkout/issues/760
144+
# This will be changed to www-data or similar on deployment by deployer.
145+
chown -R :root "$GITHUB_WORKSPACE"
146+
146147
# add github's public key
147148
curl -sL https://api.github.com/meta | jq -r '.ssh_keys | .[]' | sed -e 's/^/github.com /' >>/etc/ssh/known_hosts
148149

0 commit comments

Comments
 (0)