Skip to content

Commit dd2931b

Browse files
committed
Use sudo chown to fix wstest directory permissions
Plain chmod doesn't work on root-owned files - the runner user can't modify permissions of files it doesn't own. Use sudo chown to take ownership of the directories before upload. Note: This work was completed with AI assistance (Claude Code).
1 parent 000874b commit dd2931b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/wstest.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,14 @@ jobs:
203203
echo "==> Without-NVX client reports:"
204204
ls -la .wstest/clients-without-nvx/ | head -10 || echo "Not found"
205205
206-
# Fix permissions on wstest directories (Docker may create files as root)
206+
# Fix permissions on wstest directories (Docker creates files as root)
207207
# The verified upload action needs write access to create CHECKSUMS.sha256
208+
# Must use sudo since runner user can't chmod root-owned files
208209
- name: Fix permissions on client reports
209210
if: always()
210211
run: |
211-
chmod -R u+w .wstest/clients-with-nvx/ 2>/dev/null || true
212-
chmod -R u+w .wstest/clients-without-nvx/ 2>/dev/null || true
212+
sudo chown -R $(id -u):$(id -g) .wstest/clients-with-nvx/ 2>/dev/null || true
213+
sudo chown -R $(id -u):$(id -g) .wstest/clients-without-nvx/ 2>/dev/null || true
213214
214215
- name: Upload client reports (with-nvx)
215216
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main
@@ -423,13 +424,14 @@ jobs:
423424
echo "✅ All server tests completed for BOTH NVX configurations"
424425
echo "======================================================================"
425426
426-
# Fix permissions on wstest directories (Docker may create files as root)
427+
# Fix permissions on wstest directories (Docker creates files as root)
427428
# The verified upload action needs write access to create CHECKSUMS.sha256
429+
# Must use sudo since runner user can't chmod root-owned files
428430
- name: Fix permissions on server reports
429431
if: always()
430432
run: |
431-
chmod -R u+w .wstest/servers-with-nvx/ 2>/dev/null || true
432-
chmod -R u+w .wstest/servers-without-nvx/ 2>/dev/null || true
433+
sudo chown -R $(id -u):$(id -g) .wstest/servers-with-nvx/ 2>/dev/null || true
434+
sudo chown -R $(id -u):$(id -g) .wstest/servers-without-nvx/ 2>/dev/null || true
433435
434436
- name: Upload server reports (with-nvx)
435437
uses: wamp-proto/wamp-cicd/actions/upload-artifact-verified@main

0 commit comments

Comments
 (0)