|
24 | 24 | - name: Install PowerShell |
25 | 25 | run: brew install powershell/tap/powershell |
26 | 26 |
|
| 27 | + - name: Grant AppleScript access to Terminal.app |
| 28 | + run: | |
| 29 | + # Pre-authorize osascript to control Terminal.app via TCC database |
| 30 | + # GitHub Actions runner has sudo access |
| 31 | + sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db \ |
| 32 | + "INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, indirect_object_identifier_type, indirect_object_identifier, flags, last_modified) VALUES ('kTCCServiceAppleEvents', '/usr/bin/osascript', 1, 2, 0, 1, 0, 'com.apple.Terminal', 0, strftime('%s','now'));" 2>&1 || true |
| 33 | + # Also allow the runner agent |
| 34 | + RUNNER_PATH=$(which Runner.Listener 2>/dev/null || echo "/Users/runner/runners/*/bin/Runner.Listener") |
| 35 | + sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db \ |
| 36 | + "INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, indirect_object_identifier_type, indirect_object_identifier, flags, last_modified) VALUES ('kTCCServiceAppleEvents', '/usr/bin/osascript', 1, 2, 0, 1, 1, 'com.apple.Terminal', 0, strftime('%s','now'));" 2>&1 || true |
| 37 | + echo "TCC database updated" |
| 38 | +
|
27 | 39 | - name: Build and setup module |
28 | 40 | run: | |
29 | 41 | dotnet build PowerShell.MCP -c Release --no-incremental |
@@ -90,9 +102,10 @@ jobs: |
90 | 102 | $response = Send-JsonRpc '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"start_powershell_console","arguments":{"reason":"issue38 test","banner":"Issue #38 E2E Test"}}}' 60000 |
91 | 103 | Write-Host "Response: $($response.Substring(0, [Math]::Min(200, $response.Length)))..." |
92 | 104 |
|
93 | | - if ($response -match '"error"') { |
| 105 | + if ($response -match '"error"' -or $response -match 'Failed to start') { |
94 | 106 | Write-Host "ERROR in start_powershell_console response:" -ForegroundColor Red |
95 | 107 | Write-Host $response |
| 108 | + screencapture -x /tmp/screenshot-error.png 2>$null |
96 | 109 | throw "start_powershell_console failed" |
97 | 110 | } |
98 | 111 | Write-Host "Terminal.app console started" -ForegroundColor Green |
|
0 commit comments