Skip to content

Commit 849a6eb

Browse files
committed
TEMPORARY: Configure e2e test target via workflow input
1 parent fc7e671 commit 849a6eb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/e2e-tests.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
description: 'Target branch to run E2E tests over'
1717
required: true
1818
default: 'main'
19+
e2e-test-command:
20+
description: 'Command used for launching E2E tests'
21+
required: true
22+
default: '/run e2e'
1923

2024
permissions:
2125
checks: write
@@ -34,9 +38,9 @@ jobs:
3438
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3539
- name: Get e2e test target
3640
env:
37-
PR_COMMENT: ${{ github.event.comment.body }}
41+
PR_COMMENT: ${{ github.event.inputs.e2e-test-command }}
3842
id: get-e2e-target
39-
if: startsWith(github.event.comment.body, '/run e2e')
43+
if: startsWith(github.event.inputs.e2e-test-command, '/run e2e')
4044
run: |
4145
target=$(echo $PR_COMMENT | cut -d " " -f 3)
4246
if [ -n "${target}" ]; then
@@ -65,7 +69,7 @@ jobs:
6569
runs-on:
6670
- self-hosted
6771
- operator-e2e
68-
if: ${{ !contains(github.event.comment.html_url, '/pull/') }}
72+
if: ${{ !contains(github.event.comment.html_url, '/pull/') || github.event.inputs.e2e-test-command != '' }}
6973
steps:
7074
- name: Checkout
7175
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -106,15 +110,15 @@ jobs:
106110
environment: E2E
107111
needs: [ "run-in-k8s", "run-in-ocp" ]
108112
runs-on: ubuntu-latest
109-
if: startsWith(github.event.comment.body, '/run e2e') || contains(github.event.pull_request.labels.*.name, 'e2e test')
113+
if: startsWith(github.event.inputs.e2e-test-command, '/run e2e') || contains(github.event.pull_request.labels.*.name, 'e2e test')
110114
steps:
111115
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
112116
with:
113117
script: |
114118
github.rest.issues.createComment({
115119
owner: context.repo.owner,
116120
repo: context.repo.repo,
117-
issue_number: context.issue.number,
121+
issue_number: 4773,
118122
body: '# E2E test results\n' +
119123
'See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
120124
})
@@ -126,7 +130,7 @@ jobs:
126130
comment_id: context.payload.comment.id,
127131
content: 'hooray'
128132
})
129-
} else {
133+
} else if (context.payload.label) {
130134
github.rest.issues.removeLabel({
131135
owner: context.repo.owner,
132136
repo: context.repo.repo,

0 commit comments

Comments
 (0)