2 Commits
Author SHA1 Message Date
goukiandCursor c726bfdbd7 fix: avoid host chown after composer; prune releases in container only
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 15:09:02 +08:00
goukiandCursor c0579c502f fix: prune old releases via php container to avoid permission denied
composer-created vendor trees are not deletable by the host runner user

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 15:04:27 +08:00
+13 -1
View File
@@ -113,6 +113,10 @@ run ln -s ../../shared/storage "$host_release/storage"
run docker exec --user "$php_user" --workdir "$container_release" \ run docker exec --user "$php_user" --workdir "$container_release" \
"$PHP_CONTAINER" composer install \ "$PHP_CONTAINER" composer install \
--no-dev --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-interaction --prefer-dist --optimize-autoloader
# 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 if test "$dry_run" != "true"; then
bash -c "$BACKUP_COMMAND" bash -c "$BACKUP_COMMAND"
@@ -146,7 +150,15 @@ if test "$dry_run" != "true"; then
' '
) )
if test "${#old_releases[@]}" -gt 0; then if test "${#old_releases[@]}" -gt 0; then
rm -rf -- "${old_releases[@]}" for old_release in "${old_releases[@]}"; do
release_name="$(basename "$old_release")"
# Prefer container-side delete so root-owned vendor trees are removable.
run docker exec "$PHP_CONTAINER" \
rm -rf "$CONTAINER_DEPLOY_ROOT/releases/$release_name"
if test -e "$old_release"; then
run rm -rf -- "$old_release"
fi
done
fi fi
fi fi