Skip to content

Commit d4f9aed

Browse files
ci(audience): scope fork check to pull_request event so gate works on workflow_dispatch (SDK-255)
GHA expressions treat null == false as true, so on workflow_dispatch (where github.event.pull_request is null) the first branch of the OR gate evaluated true regardless of the selfhosted_only input. The flag had no effect. Wrapping the fork check in a github.event_name == 'pull_request' guard makes that branch only run on PR events, leaving the workflow_dispatch branch as the sole gate when the workflow is triggered manually. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0116e7e commit d4f9aed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/test-audience-sample-app.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ concurrency:
2525

2626
jobs:
2727
playmode:
28-
if: github.event.pull_request.head.repo.fork == false || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
28+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
2929
name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }}
3030
strategy:
3131
fail-fast: false
@@ -445,7 +445,7 @@ jobs:
445445
# Linux PlayMode runs on GitHub-hosted Ubuntu via GameCI Docker, not on the
446446
# self-hosted matrix above, to keep self-hosted machines free for Win/macOS.
447447
playmode-linux:
448-
if: github.event.pull_request.head.repo.fork == false || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
448+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
449449
name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }}
450450
runs-on: ubuntu-latest-8-cores
451451
strategy:
@@ -509,7 +509,7 @@ jobs:
509509
# Note: Unity 6 cells use 6000.4.5f1 (the latest patch with a GameCI image);
510510
# 6000.4.0f1 does not have a published GameCI Docker image.
511511
mobile-build:
512-
if: github.event.pull_request.head.repo.fork == false || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
512+
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event_name == 'workflow_dispatch' && github.event.inputs.selfhosted_only != 'true')
513513
name: ${{ matrix.target }} / IL2CPP / Unity ${{ matrix.unity }}
514514
runs-on: ubuntu-latest-8-cores
515515
strategy:

0 commit comments

Comments
 (0)