Skip to content

Commit be273d9

Browse files
SukuWcclaude
andcommitted
Fix file ownership after root-running container by using sudo chown
Revert --user flag since KiBot and FreeCAD are designed to run as root and depend on writing to root-owned paths inside the container. Instead, fix ownership of workspace files after stopping the container so host-side steps can write to them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3d5697e commit be273d9

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/electrical_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
docker tag ghcr.io/${{ github.repository_owner }}/knot-electrical-builder:latest builder:local
5757
fi
5858
docker run -d --name builder \
59-
--user $(id -u):$(id -g) \
6059
-v ${{ github.workspace }}:/work \
6160
-w /work \
6261
builder:local tail -f /dev/null
@@ -68,6 +67,10 @@ jobs:
6867
if: always()
6968
run: docker rm -f builder
7069

70+
- name: Fix file ownership
71+
if: always()
72+
run: sudo chown -R $USER ${{ github.workspace }}
73+
7174
- name: Print errors
7275
if: always()
7376
run: |

.github/workflows/mechanical_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
docker tag ghcr.io/${{ github.repository_owner }}/knot-mechanical-builder:latest builder:local
6161
fi
6262
docker run -d --name builder \
63-
--user $(id -u):$(id -g) \
6463
-v ${{ github.workspace }}:/work \
6564
-w /work \
6665
builder:local tail -f /dev/null
@@ -96,6 +95,10 @@ jobs:
9695
if: always()
9796
run: docker rm -f builder
9897

98+
- name: Fix file ownership
99+
if: always()
100+
run: sudo chown -R $USER ${{ github.workspace }}
101+
99102
- name: Set Date
100103
run: echo "action_date=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_ENV
101104

0 commit comments

Comments
 (0)