Skip to content

Commit 0e80ffb

Browse files
committed
Use pull_request_target event for triggering the integration test
The integration test is not being triggered for e.g. dependabot PRs. This changes the event to use `pull_request_target` to ensure that we have access to creating a status and triggering the workflow. I'm not 100% about the implications of this, as it will change the security model of the integration test. However, it should only be possible to trigger this when you already have write access or when you have explicitly been approved (since the fork PR workflow permission is set to "Require approval for all outside collaborators").
1 parent 2be82fe commit 0e80ffb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/integration-test-trigger.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ name: "Integration test (trigger only)"
33
on:
44
push:
55
branches: [main]
6-
pull_request:
6+
pull_request_target:
7+
8+
permissions:
9+
actions: write
10+
statuses: write
711

812
jobs:
913
trigger:
@@ -23,7 +27,7 @@ jobs:
2327
# The owner of the provided token must have write access to trigger this workflow run.
2428
- name: Trigger the real workflow
2529
run: |
26-
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
30+
if [ "$GITHUB_EVENT_NAME" == "pull_request_target" ]; then
2731
REF="$GITHUB_HEAD_REF"
2832
else
2933
REF="$GITHUB_REF"

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Integration tests"
33
on:
44
push:
55
branches: [main]
6-
pull_request:
6+
pull_request_target:
77

88
jobs:
99
integration-tests:

0 commit comments

Comments
 (0)