@@ -44,19 +44,19 @@ jobs:
4444
4545 dispatch :
4646 # For PRs: only if not from a fork
47- # For comments: only if user types @gemini-cli and is OWNER/MEMBER/COLLABORATOR
4847 # For issues: only on open/reopen
48+ # For comments: only if user types @gemini-cli and is OWNER/MEMBER/COLLABORATOR
4949 if : |-
5050 (
5151 github.event_name == 'pull_request' &&
5252 github.event.pull_request.head.repo.fork == false
53+ ) || (
54+ github.event_name == 'issues' &&
55+ contains(fromJSON('["opened", "reopened"]'), github.event.action)
5356 ) || (
5457 github.event.sender.type == 'User' &&
5558 startsWith(github.event.comment.body || github.event.review.body || github.event.issue.body, '@gemini-cli') &&
5659 contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || github.event.review.author_association || github.event.issue.author_association)
57- ) || (
58- github.event_name == 'issues' &&
59- contains(fromJSON('["opened", "reopened"]'), github.event.action)
6060 )
6161 runs-on : ' ubuntu-latest'
6262 permissions :
@@ -89,11 +89,15 @@ jobs:
8989 REQUEST : ' ${{ github.event.comment.body || github.event.review.body || github.event.issue.body }}'
9090 with :
9191 script : |
92+ const eventType = process.env.EVENT_TYPE;
9293 const request = process.env.REQUEST;
93- const eventType = process.env.EVENT_TYPE
9494 core.setOutput('request', request);
9595
96- if (request.startsWith("@gemini-cli /review")) {
96+ if (eventType === 'pull_request.opened') {
97+ core.setOutput('command', 'review');
98+ } else if (['issues.opened', 'issues.reopened'].includes(eventType)) {
99+ core.setOutput('command', 'triage');
100+ } else if (request.startsWith("@gemini-cli /review")) {
97101 core.setOutput('command', 'review');
98102 const additionalContext = request.replace(/^@gemini-cli \/review/, '').trim();
99103 core.setOutput('additional_context', additionalContext);
@@ -102,13 +106,9 @@ jobs:
102106 } else if (request.startsWith("@gemini-cli /fix")) {
103107 core.setOutput('command', 'fix');
104108 } else if (request.startsWith("@gemini-cli")) {
105- core.setOutput('command', 'invoke');
106109 const additionalContext = request.replace(/^@gemini-cli/, '').trim();
110+ core.setOutput('command', 'invoke');
107111 core.setOutput('additional_context', additionalContext);
108- } else if (eventType === 'pull_request.opened') {
109- core.setOutput('command', 'review');
110- } else if (['issues.opened', 'issues.reopened'].includes(eventType)) {
111- core.setOutput('command', 'triage');
112112 } else {
113113 core.setOutput('command', 'fallthrough');
114114 }
0 commit comments