Skip to content

Commit 8788d95

Browse files
committed
temp: log firewall status
1 parent ff5faff commit 8788d95

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/ui-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ jobs:
156156
security set-keychain-settings -lut 600 temporary
157157
- name: Make macOS artifact executable
158158
run: chmod -R +x 'sample-unity6/Tests/Sample Unity 6 macOS.app/Contents/MacOS'
159+
- name: Allow app through firewall
160+
run: |
161+
APP_BINARY="sample-unity6/Tests/Sample Unity 6 macOS.app/Contents/MacOS/Sample Unity 6 macOS"
162+
echo "=== Current firewall app list ==="
163+
/usr/libexec/ApplicationFirewall/socketfilterfw --listapps
164+
echo ""
165+
echo "=== Adding app to firewall allow list ==="
166+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "$APP_BINARY" || echo "⚠️ Failed to add app (managed Mac restrictions)"
167+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "$APP_BINARY" || echo "⚠️ Failed to unblock app (managed Mac restrictions)"
168+
echo ""
169+
echo "=== Updated firewall app list ==="
170+
/usr/libexec/ApplicationFirewall/socketfilterfw --listapps
159171
- uses: actions/setup-python@v4
160172
with:
161173
python-version: "3.13"
@@ -407,6 +419,18 @@ jobs:
407419
contains(matrix.targetPlatform, 'StandaloneOSX') &&
408420
(github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
409421
run: chmod -R +x '${{ matrix.projectPath }}/Tests/${{ matrix.unityAppName }}.app/Contents/MacOS'
422+
- name: Allow app through firewall
423+
if: |
424+
contains(matrix.targetPlatform, 'StandaloneOSX') &&
425+
(github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
426+
run: |
427+
APP_BINARY="${{ matrix.projectPath }}/Tests/${{ matrix.unityAppName }}.app/Contents/MacOS/${{ matrix.unityAppName }}"
428+
echo "=== Firewall status ==="
429+
/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
430+
echo ""
431+
echo "=== Adding app to firewall allow list ==="
432+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "$APP_BINARY" || echo "⚠️ Failed to add app (managed Mac restrictions)"
433+
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "$APP_BINARY" || echo "⚠️ Failed to unblock app (managed Mac restrictions)"
410434
- uses: actions/setup-python@v4
411435
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
412436
with:

0 commit comments

Comments
 (0)