3030 with :
3131 go-version : ${{ env.GO_VERSION }}
3232 cache : false
33+
34+ - name : Configure Go for ec2-user
35+ run : |
36+ # Ensure Go is properly configured for ec2-user
37+ sudo chown -R ec2-user:staff $GOPATH || true
38+ sudo chown -R ec2-user:staff $RUNNER_TOOL_CACHE/go || true
3339 # - name: Clean up previous files
3440 # run: |
3541 # sudo -u ec2-user bash rm -rf /opt/finch
@@ -44,22 +50,22 @@ jobs:
4450 # Debug step to see available users
4551 - name : List available users and system info
4652 run : |
47- echo "Current user: $(whoami)"
53+ sudo -u ec2-user bash -c ' echo "Current user: $(whoami)"
4854 echo "Current user ID: $(id -u)"
4955 echo "Current user home: $HOME"
5056 echo "Console user: $(stat -f "%Su" /dev/console)"
5157 echo "All users:"
52- dscl . -list /Users | grep -v '^_'
58+ dscl . -list /Users | grep -v "^_"
5359 echo "Users with home directories:"
5460 ls -la /Users/
5561 echo "Environment variables:"
5662 env | sort
5763 echo "Brew info:"
5864 which brew || echo "brew not found in PATH"
59- echo "PATH: $PATH"
65+ echo "PATH: $PATH"'
6066
6167 - name : Install Rosetta 2
62- run : echo "A" | softwareupdate --install-rosetta || true
68+ run : sudo -u ec2-user bash -c ' echo "A" | sudo softwareupdate --install-rosetta || true'
6369
6470 # Fix Homebrew permissions and setup environment
6571 - name : Fix Homebrew permissions and setup environment
@@ -123,17 +129,17 @@ jobs:
123129 # Check for Finch socket
124130 - name : Check for Finch socket
125131 run : |
126- echo "Checking for Finch socket at /Applications/Finch/lima/data/finch/sock/finch.sock..."
132+ sudo -u ec2-user bash -c ' echo "Checking for Finch socket at /Applications/Finch/lima/data/finch/sock/finch.sock..."
127133
128134 # Check if the socket file exists
129- if sudo -u ec2-user bash -c ' test -S /Applications/Finch/lima/data/finch/sock/finch.sock' ; then
135+ if test -S /Applications/Finch/lima/data/finch/sock/finch.sock; then
130136 echo "Socket file exists"
131137 else
132138 echo "ERROR: Socket file not found at expected location /Applications/Finch/lima/data/finch/sock/finch.sock"
133139 exit 1
134- fi
140+ fi'
135141
136- # Store the socket path for later steps
142+ # Store the socket path for later steps (this needs to run as root to modify GITHUB_ENV)
137143 echo "SOCKET_PATH=/Applications/Finch/lima/data/finch/sock/finch.sock" >> $GITHUB_ENV
138144 shell : bash
139145
@@ -144,6 +150,11 @@ jobs:
144150 persist-credentials : false
145151 submodules : recursive
146152 ssh-user : ec2-user
153+
154+ - name : Configure workspace for ec2-user
155+ run : |
156+ # Ensure workspace is properly owned by ec2-user
157+ sudo chown -R ec2-user:staff ${{ github.workspace }}
147158 # Run e2e tests inside the Finch VM
148159 - name : Run e2e tests
149160 run : |
0 commit comments