Skip to content

Commit 4254918

Browse files
authored
fix(ci): restore pull_request_target trigger for PR gate (#1282)
The Blacksmith migration (#1249) changed the PR Gate trigger from `pull_request_target` to `pull_request`. For PRs opened by outside contributors, `pull_request` workflows are gated as `action_required` and do not run without a maintainer manually approving them, so the auto-close gate silently stopped firing (e.g. #1281 stayed open). Restore `pull_request_target` so the gate runs with the base repo's write permissions and can close unapproved PRs automatically. This workflow never checks out PR code — it only calls the GitHub API via github-script — so the usual pull_request_target injection risk does not apply. Added an inline comment documenting the requirement to prevent the same regression in future workflow edits.
1 parent f28fa45 commit 4254918

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎.github/workflows/pr-gate.yaml‎

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

3+
# Must be pull_request_target, NOT pull_request: only the target variant runs
4+
# with the base repo's write permissions for forked/outside-contributor PRs.
5+
# With plain `pull_request`, outside-contributor runs are gated as
6+
# `action_required` and never execute, so the auto-close gate silently no-ops.
7+
# This workflow never checks out PR code (it only calls the GitHub API via
8+
# github-script), so the usual pull_request_target injection risk does not apply.
39
on:
4-
pull_request:
10+
pull_request_target:
511
types:
612
- opened
713

0 commit comments

Comments
 (0)