Skip to content

Commit 22ddc2c

Browse files
authored
only trigger e2e on run-e2e-test label, auto-remove on new pushes (opendatahub-io#55)
Signed-off-by: Aneesh Puttur <aneeshputtur@gmail.com>
1 parent d449841 commit 22ddc2c

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/e2e-mock-test.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,46 @@ name: E2E Mock vLLM Test
22

33
on:
44
pull_request_target:
5-
types: [opened, labeled, synchronize, reopened]
5+
types: [labeled, synchronize]
66
branches: [main]
77

8-
permissions:
9-
contents: read
8+
permissions: {}
109

1110
env:
1211
MOCK_IMAGE: localhost/vllm-mock:test
1312
MOCK_NAMESPACE: mock-vllm-test
1413
KIND_CLUSTER_NAME: rhaii-e2e
1514

1615
jobs:
16+
# Remove run-e2e-test label on new pushes to force re-review
17+
remove-label-on-push:
18+
name: Remove e2e label on push
19+
permissions:
20+
pull-requests: write
21+
if: >-
22+
github.event.action == 'synchronize' &&
23+
contains(github.event.pull_request.labels.*.name, 'run-e2e-test')
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Remove run-e2e-test label
27+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
28+
with:
29+
script: |
30+
await github.rest.issues.removeLabel({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
issue_number: context.payload.pull_request.number,
34+
name: 'run-e2e-test'
35+
});
36+
console.log('Removed run-e2e-test label — maintainer must re-add after reviewing new code');
37+
1738
e2e-test:
1839
name: E2E Mock vLLM Test
19-
# Label gate: only runs when a maintainer adds this label, preventing
20-
# untrusted fork PRs from executing arbitrary code with repo secrets.
21-
if: contains(github.event.pull_request.labels.*.name, 'run-e2e-test')
40+
permissions:
41+
contents: read
42+
# Only runs when a maintainer adds the run-e2e-test label specifically.
43+
# Does not trigger on other labels or on synchronize (new pushes).
44+
if: github.event.action == 'labeled' && github.event.label.name == 'run-e2e-test'
2245
runs-on: ubuntu-latest
2346
steps:
2447
- name: Checkout PR code

0 commit comments

Comments
 (0)