Skip to content

Commit 8b6efe3

Browse files
committed
Do not require approval for CI commits on main
1 parent 15c2d14 commit 8b6efe3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ jobs:
6161
tests:
6262
name: Tests
6363
runs-on: ubuntu-latest
64-
# SECURITY: Use environment protection for external contributors
65-
environment: ${{ github.event.pull_request.head.repo.full_name != github.repository && 'external-testing' || '' }}
64+
# SECURITY: Use environment protection for external contributors only
65+
# Push events and internal PRs run without environment protection
66+
# External PRs require manual approval via 'external-testing' environment
67+
environment: ${{ (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && '' || 'external-testing' }}
6668
# Run tests with secrets for:
6769
# 1. Push to main (trusted), OR
68-
# 2. PR from same repository (trusted)
69-
# For external PRs: environment protection requires manual approval
70+
# 2. PR from same repository (trusted), OR
71+
# 3. External PR (requires manual approval via environment protection)
7072
if: |
7173
github.event_name == 'push' ||
72-
(github.event.pull_request.head.repo.full_name == github.repository)
74+
github.event_name == 'pull_request_target'
7375
7476
steps:
7577
- name: Checkout sources

0 commit comments

Comments
 (0)