Skip to content

Commit 36d7b12

Browse files
authored
Merge pull request #4656 from kiwicom/rcsl/diy-code-review
chore: enable Gemini-powered review on all pull requests
2 parents dddd4a8 + e301460 commit 36d7b12

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/code-review.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Analyze PR Diff with LLM
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [opened, synchronize]
66
branches:
7-
- rcsl/code-review
7+
- "**"
88

99
# Add permissions needed to comment on PRs
1010
permissions:
@@ -204,8 +204,7 @@ jobs:
204204
205205
- name: Analyze diff with LLM
206206
env:
207-
PORTKEY_API_KEY: ${{ secrets.PORTKEY_API_KEY }}
208-
PORTKEY_VIRTUAL_KEY_GOOGLE: ${{ secrets.PORTKEY_VIRTUAL_KEY_GOOGLE }}
207+
CODE_REVIEW_GEMINI_API_KEY: ${{ secrets.CODE_REVIEW_GEMINI_API_KEY }}
209208
GITHUB_REPOSITORY: ${{ github.repository }}
210209
PR_NUMBER: ${{ github.event.pull_request.number }}
211210
PR_TITLE: ${{ github.event.pull_request.title }}
@@ -219,8 +218,11 @@ jobs:
219218
const fs = require('fs');
220219
const analysis = fs.readFileSync('llm_analysis.md', 'utf8');
221220
221+
// Get the PR number from the event
222+
const prNumber = ${{ github.event.pull_request.number }};
223+
222224
github.rest.issues.createComment({
223-
issue_number: context.issue.number,
225+
issue_number: prNumber,
224226
owner: context.repo.owner,
225227
repo: context.repo.repo,
226228
body: `## LLM Analysis of PR Changes\n\n${analysis}`

0 commit comments

Comments
 (0)