Skip to content

Commit 06c227a

Browse files
author
Claude
committed
Attempt to fix devcontainer perms
1 parent 39cbac2 commit 06c227a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"mounts": [
2626
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
2727
"source=${localWorkspaceFolderBasename}-catnip-volume,target=/home/vscode/.catnip/volume,type=volume",
28-
"source=${localWorkspaceFolderBasename}-go-mods,target=/go/pkg/mod,type=volume"
28+
"source=${localWorkspaceFolderBasename}-go-mods,target=/go/pkg/mod,type=volume,uid=1000,gid=1000"
2929
],
3030
"features": {
3131
"ghcr.io/devcontainers/features/git:1": {},

.devcontainer/post-create.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@ OPT_DIR="/opt/catnip"
66

77
# ensure mounted volumes have proper permissions
88
sudo install -d -o "$USER" -g "$USER" "$WORKDIR/node_modules"
9+
# Ensure /go/pkg exists and fix ownership only where needed
910
sudo install -d -o "$USER" -g "$USER" "/go/pkg"
11+
12+
# Only fix permissions if they're actually wrong (much faster than chmod -R)
13+
if [ "$(stat -c '%U:%G' /go/pkg 2>/dev/null)" != "$USER:$USER" ]; then
14+
echo "Fixing /go/pkg permissions..."
15+
sudo chown "$USER:$USER" /go/pkg
16+
fi
17+
18+
# Fix subdirectories only if they exist and have wrong ownership
19+
if [ -d "/go/pkg/mod" ] && [ "$(stat -c '%U:%G' /go/pkg/mod 2>/dev/null)" != "$USER:$USER" ]; then
20+
echo "Fixing /go/pkg/mod permissions..."
21+
sudo chown -R "$USER:$USER" /go/pkg/mod
22+
fi
1023
sudo install -d -o "$USER" -g "$USER" "/home/vscode/.catnip/volume"
1124

1225
# Run the main setup script (it will handle installing pnpm and just if needed)

.github/workflows/publish-feature.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
permissions:
1010
contents: write
1111
packages: write
12+
id-token: write
1213
pull-requests: write
1314
steps:
1415
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)