Skip to content

Commit 50de507

Browse files
committed
allow external contributors to run our e2e tests
1 parent abde333 commit 50de507

8 files changed

+57
-8
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CodeFlash
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
paths:
66
- "**"
77
workflow_dispatch:
@@ -26,6 +26,12 @@ jobs:
2626
uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 0
29+
- name: Validate PR
30+
run: |
31+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "codeflash-optimize.yaml"; then
32+
echo "This workflow file has been modified. Exiting for security."
33+
exit 1
34+
fi
2935
3036
- name: 🐍 Set up Python 3.11 for CLI
3137
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-bubblesort-pytest-no-git.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
2430
2531
- name: Set up Python 3.11 for CLI
2632
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-bubblesort-unittest.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-bubblesort-unittest.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
2430
2531
- name: Set up Python 3.11 for CLI
2632
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-coverage.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Coverage E2E
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -19,6 +19,12 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121
token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Validate PR
23+
run: |
24+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-coverage.yaml"; then
25+
echo "This workflow file has been modified. Exiting for security."
26+
exit 1
27+
fi
2228
2329
- name: Set up Python 3.11 for CLI
2430
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-futurehouse.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-futurehouse.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
2430
2531
- name: Set up Python 3.11 for CLI
2632
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-init-optim.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-init-optim.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
2430
2531
- name: Set up Python 3.11 for CLI
2632
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-test-tracer-replay.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,13 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-test-tracer-replay.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
30+
2431
2532
- name: Set up Python 3.11 for CLI
2633
uses: astral-sh/setup-uv@v5

.github/workflows/end-to-end-topological-sort-test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: end-to-end-test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
workflow_dispatch:
66

77
jobs:
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Validate PR
25+
run: |
26+
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q "end-to-end-topological-sort-test.yaml"; then
27+
echo "This workflow file has been modified. Exiting for security."
28+
exit 1
29+
fi
2430
2531
- name: Set up Python 3.11 for CLI
2632
uses: astral-sh/setup-uv@v5

0 commit comments

Comments
 (0)