Skip to content

Commit 64a6642

Browse files
committed
Auto trigger PR reviews when they are from branches in repo
Pull request events identify members as "contributors", so the workflows are not auto-triggered. But there are some contributors who are not members, so workflows would fail on forks. In this change, we switch the condition for PR events to check for whether the PR was created from a branch in the repo or from a fork. Note that only users with write access to the repo can create branches.
1 parent e4b0716 commit 64a6642

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/gemini-dispatch.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ jobs:
4343
env | grep '^DEBUG_'
4444
4545
dispatch:
46+
# For PRs: only if not from a fork
47+
# For comments: only if user types @gemini-cli and is OWNER/MEMBER/COLLABORATOR
48+
# For issues: only on open/reopen
4649
if: |-
4750
(
4851
github.event_name == 'pull_request' &&
49-
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
52+
github.event.pull_request.head.repo.fork == false
5053
) || (
5154
github.event.sender.type == 'User' &&
5255
startsWith(github.event.comment.body || github.event.review.body || github.event.issue.body, '@gemini-cli') &&

0 commit comments

Comments
 (0)