Actions: relax perms before cleanup to avoid Permission denied; keep docker root fallback
This commit is contained in:
parent
f3cb9038b7
commit
fc1bdc248b
1 changed files with 2 additions and 0 deletions
2
.github/workflows/ci-cd-web-desktop.yml
vendored
2
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -269,6 +269,7 @@ jobs:
|
||||||
echo "Skipping active dir (in use by APP_DIR): $dir"; continue
|
echo "Skipping active dir (in use by APP_DIR): $dir"; continue
|
||||||
fi
|
fi
|
||||||
echo "Removing $dir"
|
echo "Removing $dir"
|
||||||
|
chmod -R u+rwX "$dir" 2>/dev/null || true
|
||||||
rm -rf "$dir" || {
|
rm -rf "$dir" || {
|
||||||
echo "Local rm failed, falling back to docker (root) cleanup for $dir..."
|
echo "Local rm failed, falling back to docker (root) cleanup for $dir..."
|
||||||
docker run --rm -v "$dir":/target alpine:3 sh -lc 'chown -R 1000:1000 /target 2>/dev/null || true; chmod -R u+rwX /target 2>/dev/null || true; rm -rf /target/* /target/.[!.]* /target/..?* 2>/dev/null || true' || true
|
docker run --rm -v "$dir":/target alpine:3 sh -lc 'chown -R 1000:1000 /target 2>/dev/null || true; chmod -R u+rwX /target 2>/dev/null || true; rm -rf /target/* /target/.[!.]* /target/..?* 2>/dev/null || true' || true
|
||||||
|
|
@ -397,6 +398,7 @@ jobs:
|
||||||
echo "$LIST" | sed "1,${KEEP}d" | while read dir; do
|
echo "$LIST" | sed "1,${KEEP}d" | while read dir; do
|
||||||
[ -z "$dir" ] && continue
|
[ -z "$dir" ] && continue
|
||||||
echo "Removing $dir"
|
echo "Removing $dir"
|
||||||
|
chmod -R u+rwX "$dir" 2>/dev/null || true
|
||||||
rm -rf "$dir" || {
|
rm -rf "$dir" || {
|
||||||
echo "Local rm failed, falling back to docker (root) cleanup for $dir..."
|
echo "Local rm failed, falling back to docker (root) cleanup for $dir..."
|
||||||
docker run --rm -v "$dir":/target alpine:3 sh -lc 'chown -R 1000:1000 /target 2>/dev/null || true; chmod -R u+rwX /target 2>/dev/null || true; rm -rf /target/* /target/.[!.]* /target/..?* 2>/dev/null || true' || true
|
docker run --rm -v "$dir":/target alpine:3 sh -lc 'chown -R 1000:1000 /target 2>/dev/null || true; chmod -R u+rwX /target 2>/dev/null || true; rm -rf /target/* /target/.[!.]* /target/..?* 2>/dev/null || true' || true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue