Skip to content

Commit f71d5a6

Browse files
committed
Allow unsafe
This is not ideal but is equivalent to what is happening with the v4 version of the action today. Explicit opt-it is required in v7. Actions using pull_request_target that are running code from PRs from forks should be reevaluated so that tests can run without the risk of compromising the repository. (cherry picked from commit 18bb240)
1 parent eaa261e commit f71d5a6

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎.github/workflows/e2e_tests.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
# On push → the pushed commit that triggered the workflow.
3535
ref: ${{ github.event.pull_request.head.ref || github.sha }}
3636

37+
# Tests need access to secrets.
38+
# This should be refactored if possible to mitigate the risk.
39+
# https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
40+
allow-unsafe-pr-checkout: true
41+
3742
# Don’t keep credentials when running untrusted PR code under PR_TARGET.
3843
persist-credentials: ${{ github.event_name != 'pull_request_target' }}
3944

‎.github/workflows/e2e_tests_lightspeed_evaluation.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
# Don’t keep credentials when running untrusted PR code under PR_TARGET.
3131
persist-credentials: ${{ github.event_name != 'pull_request_target' }}
3232

33+
# Tests need access to secrets.
34+
# This should be refactored if possible to mitigate the risk.
35+
# https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
36+
allow-unsafe-pr-checkout: true
37+
3338
# Fetch submodules (required for lightspeed-providers)
3439
submodules: 'recursive'
3540

‎.github/workflows/e2e_tests_providers.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
E2E_DEFAULT_PROVIDER_OVERRIDE: ${{ matrix.e2e_default_provider }}
5050

5151
steps:
52-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@v7
5353
with:
5454
# On PR_TARGET → the fork (or same repo) that opened the PR.
5555
# On push → falls back to the current repository.
@@ -59,6 +59,11 @@ jobs:
5959
# On push → the pushed commit that triggered the workflow.
6060
ref: ${{ github.event.pull_request.head.ref || github.sha }}
6161

62+
# Tests need access to secrets.
63+
# This should be refactored if possible to mitigate the risk.
64+
# https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
65+
allow-unsafe-pr-checkout: true
66+
6267
# Don’t keep credentials when running untrusted PR code under PR_TARGET.
6368
persist-credentials: ${{ github.event_name != 'pull_request_target' }}
6469

‎.github/workflows/e2e_tests_rhaiis.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ jobs:
4848
# On push → the pushed commit that triggered the workflow.
4949
ref: ${{ github.event.pull_request.head.ref || github.sha }}
5050

51+
# Tests need access to secrets.
52+
# This should be refactored if possible to mitigate the risk.
53+
# https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
54+
allow-unsafe-pr-checkout: true
55+
5156
# Don’t keep credentials when running untrusted PR code under PR_TARGET.
5257
persist-credentials: ${{ github.event_name != 'pull_request_target' }}
5358

0 commit comments

Comments
 (0)