Skip to content

Commit 071619c

Browse files
committed
only run e2e tests on PRs
e2e trigger will only run when a PR is in one of these states: - opened - reopened - synchronize - ready_for_review (out of draft)
1 parent 1783c42 commit 071619c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/pr-workflow.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: PR e2e Tests
22

33
on:
4-
workflow_run:
5-
workflows: ["dev-workflow"]
6-
types: [completed]
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
- ready_for_review
710

811
jobs:
912
trigger-e2e-tests:
10-
if: >
11-
github.event.workflow_run.conclusion == 'success' &&
12-
github.event.workflow_run.event == 'pull_request'
1313
runs-on: ubuntu-latest
1414

1515
steps:

scripts/e2e-trigger.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ if [[ "${CI}" != "true" ]]; then
88
exit 1
99
fi
1010

11+
if [[ -n "${GITHUB_HEAD_REF}" ]]; then
12+
TEST_NLK_CHART_REF="${GITHUB_HEAD_REF}"
13+
else
14+
TEST_NLK_CHART_REF="${GITHUB_REF_NAME}"
15+
fi
16+
17+
TEST_NLK_CHART_URL="oci://${DOCKER_REGISTRY_PROD}/nginx-azure-lb/nginxaas-loadbalancer-kubernetes/charts/${TEST_NLK_CHART_REF}/nginxaas-loadbalancer-kubernetes"
1118
TEST_NLK_IMG_TAG=$(cat version)
12-
TEST_NLK_CHART_URL="oci://${DOCKER_REGISTRY_PROD}/nginx-azure-lb/nginxaas-loadbalancer-kubernetes/charts/${GITHUB_REF_NAME}/nginxaas-loadbalancer-kubernetes"
1319
GITLAB_API="${GITLAB_API_URL:-https://gitlab.com/api/v4}"
1420

1521
GITLAB_PIPELINE_ID=$(curl -sS --fail-with-body -X POST \

0 commit comments

Comments
 (0)