Skip to content

Commit cebf93e

Browse files
improve e2e test oss conductor version selection to have a fallback for fork repo PRs which won't get access to the variable.
1 parent 98486f3 commit cebf93e

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

‎.github/workflows/integration-tests.yml‎

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
oss_conductor_version:
11-
description: 'OSS Conductor image tag (falls back to E2E_TEST_OSS_CONDUCTOR_VERSION org var)'
11+
description: 'OSS Conductor image tag (falls back to E2E_TEST_OSS_CONDUCTOR_VERSION org var, then to a pinned default on fork PRs)'
1212
required: false
1313
type: string
1414

@@ -99,16 +99,41 @@ jobs:
9999
env:
100100
CONDUCTOR_SERVER_URL: http://localhost:8080/api
101101
CONDUCTOR_SERVER_TYPE: oss
102-
OSS_CONDUCTOR_VERSION: ${{ inputs.oss_conductor_version || vars.E2E_TEST_OSS_CONDUCTOR_VERSION }}
102+
# Used only when the org variable is unreachable because the run is a fork
103+
# PR -- see the resolve step below.
104+
FORK_PR_FALLBACK_VERSION: '3.32.3'
103105

104106
steps:
105-
- name: Verify OSS Conductor version is set
107+
# OSS_CONDUCTOR_VERSION is resolved here rather than in the job `env` so
108+
# that the two ways it can come back empty get different treatment:
109+
#
110+
# - Fork PR: GitHub withholds org/repo variables from pull_request runs
111+
# on forks exactly as it withholds secrets, so vars.* is always "" for
112+
# an outside contributor (observed in csharp-sdk#178). This job needs
113+
# no secrets, only a tag, so pin one and keep running. Note that the
114+
# workflow_run trigger above executes in the base repo's context and
115+
# does get the org variable even for a fork PR; the fork branch here
116+
# matters for the push/dispatch paths and for any future direct
117+
# pull_request trigger.
118+
# - Anything else: the org variable is genuinely missing or its
119+
# repository access policy no longer covers this repo. Fail loudly
120+
# rather than silently drifting onto the pin.
121+
- name: Resolve OSS Conductor version
122+
env:
123+
REQUESTED_VERSION: ${{ inputs.oss_conductor_version || vars.E2E_TEST_OSS_CONDUCTOR_VERSION }}
124+
IS_FORK_PR: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_run' && github.event.workflow_run.head_repository.full_name != github.repository) }}
106125
run: |
107-
if [ -z "$OSS_CONDUCTOR_VERSION" ]; then
126+
if [ -n "$REQUESTED_VERSION" ]; then
127+
resolved="$REQUESTED_VERSION"
128+
elif [ "$IS_FORK_PR" = "true" ]; then
129+
resolved="$FORK_PR_FALLBACK_VERSION"
130+
echo "::notice::Fork PR: org variables are withheld, pinning conductoross/conductor:${resolved}"
131+
else
108132
echo "::error::No Conductor OSS image tag resolved. Set the E2E_TEST_OSS_CONDUCTOR_VERSION organization variable (and ensure its repository access policy includes this repo), or pass the oss_conductor_version input via workflow_dispatch."
109133
exit 1
110134
fi
111-
echo "Using conductoross/conductor:$OSS_CONDUCTOR_VERSION"
135+
echo "OSS_CONDUCTOR_VERSION=${resolved}" >> "$GITHUB_ENV"
136+
echo "Using conductoross/conductor:${resolved}"
112137
113138
- name: Checkout
114139
uses: actions/checkout@v6

0 commit comments

Comments
 (0)