Skip to content

Commit 41a4104

Browse files
committed
fix pr
1 parent b7e4da5 commit 41a4104

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/ci/run.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ change_ownership_if_needed() {
66
local path=$1
77
local owner="user:user"
88
local current_owner=$(stat -f "%Su:%Sg" "$path" 2>/dev/null)
9-
10-
if [ "$current_owner" != "$owner" ]; then
11-
chown -R $owner "$path"
9+
local test_file="$path/.write_test"
10+
11+
# Test if filesystem is writable by attempting to touch a temporary file
12+
if touch "$test_file" 2>/dev/null; then
13+
rm "$test_file"
14+
if [ "$current_owner" != "$owner" ]; then
15+
chown -R $owner "$path"
16+
fi
17+
else
18+
echo "$path is read-only, skipping ownership change"
1219
fi
1320
}
1421

0 commit comments

Comments
 (0)