Skip to content

Commit 7ed0dd7

Browse files
[no-relnote] Fix E2E matrix conditional
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 0920018 commit 7ed0dd7

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,24 @@ jobs:
2929
runs-on: ubuntu-latest
3030
outputs:
3131
version: ${{ steps.version.outputs.version }}
32+
is_pull_request: ${{ steps.is_pull_request.outputs.is_pull_request }}
3233
steps:
3334
- name: Generate Commit Short SHA
3435
id: version
3536
run: echo "version=$(echo $GITHUB_SHA | cut -c1-8)" >> "$GITHUB_OUTPUT"
37+
- name: Determine if push is to main or release branch
38+
id: is_pull_request
39+
run: |
40+
# Extract the branch name from the ref (e.g., refs/heads/main -> main)
41+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
42+
43+
# If the branch is 'main' or starts with 'release-', this is _not_ a pull request-equivalent push
44+
# Otherwise, treat it as a pull-request branch (e.g., 'pull-request/123')
45+
if [[ "$BRANCH_NAME" == "main" || "$BRANCH_NAME" == release-* ]]; then
46+
echo "is_pull_request=false" >> "$GITHUB_OUTPUT"
47+
else
48+
echo "is_pull_request=true" >> "$GITHUB_OUTPUT"
49+
fi
3650
3751
golang:
3852
uses: ./.github/workflows/golang.yaml
@@ -51,3 +65,4 @@ jobs:
5165
uses: ./.github/workflows/e2e.yaml
5266
with:
5367
version: ${{ needs.variables.outputs.version }}
68+
is_pull_request: ${{ needs.variables.outputs.is_pull_request }}

.github/workflows/e2e.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
version:
2121
required: true
2222
type: string
23+
is_pull_request:
24+
required: true
25+
type: string
2326
secrets:
2427
AWS_ACCESS_KEY_ID:
2528
required: true
@@ -39,8 +42,7 @@ jobs:
3942
runs-on: linux-amd64-cpu4
4043
strategy:
4144
matrix:
42-
is_pull_request:
43-
- ${{!( startsWith(github.ref, 'refs/pull/') )}}
45+
is_pull_request: ${{ contains(inputs.is_pull_request, 'true') }}
4446
driver_branch:
4547
- 550
4648
- 575

0 commit comments

Comments
 (0)