Skip to content

Commit 5ec2b6c

Browse files
authored
Merge pull request d-run#402 from windsonsea/manual
remove pr-create condition to trigger gemini
2 parents b25d660 + ee847cf commit 5ec2b6c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

.github/workflows/code-review.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Gemini AI Code Reviewer
22
on:
3-
pull_request:
4-
types: [opened]
53
issue_comment:
64
types: [created]
75
pull_request_review_comment:
@@ -16,7 +14,6 @@ jobs:
1614
gemini-code-review:
1715
runs-on: ubuntu-latest
1816
if: >
19-
github.event_name == 'pull_request' ||
2017
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/gemini-review')) ||
2118
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/gemini-review'))
2219
steps:
@@ -32,23 +29,16 @@ jobs:
3229
env:
3330
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3431
GITHUB_EVENT_NAME: ${{ github.event_name }}
35-
PR_NUMBER_PR: ${{ github.event.pull_request.number }}
3632
PR_NUMBER_ISSUE: ${{ github.event.issue.number }}
3733
PR_NUMBER_FALLBACK: ${{ github.event.pull_request.number }}
3834
run: |
39-
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
40-
PR_NUMBER=$PR_NUMBER_PR
41-
MESSAGE="Thanks for your contribution! Gemini AI Code Reviewer has started reviewing this PR and will provide detailed feedback in about 3 minutes. Please wait a moment."
35+
# Try issue number first, fallback to pull request number
36+
if [ -n "$PR_NUMBER_ISSUE" ]; then
37+
PR_NUMBER=$PR_NUMBER_ISSUE
4238
else
43-
# Try issue number first, fallback to pull request number
44-
if [ -n "$PR_NUMBER_ISSUE" ]; then
45-
PR_NUMBER=$PR_NUMBER_ISSUE
46-
else
47-
PR_NUMBER=$PR_NUMBER_FALLBACK
48-
fi
49-
MESSAGE="Thanks for triggering the review! Gemini AI Code Reviewer has started reviewing this PR and will provide detailed feedback in about 3 minutes. Please wait a moment."
39+
PR_NUMBER=$PR_NUMBER_FALLBACK
5040
fi
51-
41+
MESSAGE="Thanks for triggering the review! Gemini AI Code Reviewer has started reviewing this PR and will provide detailed feedback in about 3 minutes. Please wait a moment."
5242
gh issue comment $PR_NUMBER --body "$MESSAGE"
5343
5444
- id: pr

0 commit comments

Comments
 (0)