fix: fix_permissions.sh fails on empty directory (#83)

This commit fixes
https://github.com/vegardit/docker-gitea-act-runner/issues/82
This commit is contained in:
Andrii Bratanin 2025-09-04 11:10:40 +03:00 committed by GitHub
parent 00a1330dab
commit c035980662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ if [[ -n ${GITEA_RUNNER_UID:-} ]]; then
act_home=$(eval echo "~$act_user")
chown "$GITEA_RUNNER_UID" "$act_home"
find "$act_home" -xdev -user "$effective_uid" -print0 | xargs -0 chown "$GITEA_RUNNER_UID"
find "$act_home" -xdev -user "$effective_uid" -print0 | xargs --no-run-if-empty -0 chown "$GITEA_RUNNER_UID"
fi
fi
@ -38,7 +38,7 @@ if [[ -n ${GITEA_RUNNER_GID:-} ]]; then
act_home=$(eval echo "~$act_user")
chown ":$GITEA_RUNNER_GID" "$act_home"
find "$act_home" -xdev -group "$effective_gid" -print0 | xargs -0 chgrp "$GITEA_RUNNER_GID"
find "$act_home" -xdev -group "$effective_gid" -print0 | xargs --no-run-if-empty -0 chgrp "$GITEA_RUNNER_GID"
fi
fi