From 07bd1046c4ea4fef20ee5ca825b9960f16255642 Mon Sep 17 00:00:00 2001 From: scalvela Date: Thu, 25 Jun 2026 20:32:44 -0400 Subject: [PATCH] Exclude fork PRs from Gemini dispatch (consistency with hardened template) gemini-dispatch.yml's dispatch `if` allowed `github.event_name == 'pull_request'` without the `&& github.event.pull_request.head.repo.fork == false` guard used by the equivalent workflows in GoogleCloudPlatform/vertex-ai-creative-studio and gemini-cloud-assist-mcp (and the run-gemini-cli reference template). Because this trigger is `pull_request` (not `pull_request_target`), fork PRs run without secrets or a write token, so there is no secret-exposure issue today. This is a hardening/consistency change: it avoids spinning up the review agent on untrusted fork PRs and guards against a future switch to a `pull_request_target` trigger. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/gemini-dispatch.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gemini-dispatch.yml b/.github/workflows/gemini-dispatch.yml index 5da504ea..aa0f9d2c 100644 --- a/.github/workflows/gemini-dispatch.yml +++ b/.github/workflows/gemini-dispatch.yml @@ -43,12 +43,13 @@ jobs: env | grep '^DEBUG_' dispatch: - # For PRs + # For PRs: only if not from a fork # For comments: only if user types @gemini-cli and is OWNER/MEMBER/COLLABORATOR # For issues: only on open/reopen if: |- ( - github.event_name == 'pull_request' + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.fork == false ) || ( github.event.sender.type == 'User' && startsWith(github.event.comment.body || github.event.review.body || github.event.issue.body, '@gemini-cli') &&