We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7e4da5 commit 41a4104Copy full SHA for 41a4104
src/ci/run.sh
@@ -6,9 +6,16 @@ change_ownership_if_needed() {
6
local path=$1
7
local owner="user:user"
8
local current_owner=$(stat -f "%Su:%Sg" "$path" 2>/dev/null)
9
-
10
- if [ "$current_owner" != "$owner" ]; then
11
- chown -R $owner "$path"
+ local test_file="$path/.write_test"
+
+ # 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"
19
fi
20
}
21
0 commit comments