Skip to content

Commit 28a96a3

Browse files
authored
Do NOT use pull_request_target events (#1446)
Just avoid contributions to run ANY tests at all by default. Instead, testing needs to be excplictly alloed by lebaling the PR after inspecting it looks sane. Signed-off-by: jose.vazquez <[email protected]>
1 parent ea8efbc commit 28a96a3

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
- '**'
1313
paths-ignore:
1414
- 'docs/**'
15-
pull_request_target:
16-
paths-ignore:
17-
- 'docs/**'
1815
merge_group:
1916
workflow_dispatch:
2017

@@ -23,19 +20,42 @@ concurrency:
2320
cancel-in-progress: true
2421

2522
jobs:
23+
run-tests:
24+
name: Run Tests
25+
runs-on: ubuntu-latest
26+
# Contributions do NOT run any testing by default, a label is needed to allow testing
27+
if: |
28+
github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name ||
29+
contains(github.event.pull_request.labels.*.name, 'safe-to-test') ||
30+
contains(github.event.pull_request.labels.*.name, 'cloud-tests') ||
31+
contains(github.event.pull_request.labels.*.name, 'retest')
32+
steps:
33+
- name: allowed message
34+
run: echo "Allowed to run tests"
35+
2636
lint:
37+
needs:
38+
- run-tests
2739
uses: ./.github/workflows/lint.yaml
2840

2941
validate-manifests:
42+
needs:
43+
- run-tests
3044
uses: ./.github/workflows/validate-manifests.yml
3145

3246
unit-tests:
47+
needs:
48+
- run-tests
3349
uses: ./.github/workflows/test-unit.yml
3450

3551
check-licenses:
52+
needs:
53+
- run-tests
3654
uses: ./.github/workflows/check-licenses.yml
3755

3856
cloud-tests-filter:
57+
needs:
58+
- run-tests
3959
uses: ./.github/workflows/cloud-tests-filter.yml
4060

4161
cloud-tests:

0 commit comments

Comments
 (0)