fix: avoid host chown after composer; prune releases in container only

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-07-18 15:09:02 +08:00
co-authored by Cursor
parent c0579c502f
commit c726bfdbd7
+4 -8
View File
@@ -113,14 +113,10 @@ run ln -s ../../shared/storage "$host_release/storage"
run docker exec --user "$php_user" --workdir "$container_release" \
"$PHP_CONTAINER" composer install \
--no-dev --no-interaction --prefer-dist --optimize-autoloader
# Composer runs as the PHP user and creates host files that the runner cannot
# delete later during release pruning. Normalize ownership back to the runner.
if id act_runner >/dev/null 2>&1; then
run chown -R act_runner:"$php_group" "$host_release"
else
run chgrp -R "$php_group" "$host_release"
fi
run chmod -R g+rwX "$host_release"
# Keep the release readable by the PHP runtime group. Do not chown on the host:
# act_runner cannot change ownership of files created inside the container.
run docker exec "$PHP_CONTAINER" sh -c \
"chown -R ${php_user} '${container_release}' && chmod -R g+rwX '${container_release}'"
if test "$dry_run" != "true"; then
bash -c "$BACKUP_COMMAND"