Skip to content

Commit 1b8e2b0

Browse files
committed
update the generic workflow example
1 parent af8357d commit 1b8e2b0

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

examples/workflows/pr-review/gemini-pr-review.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ jobs:
213213
3. Run: echo "${PR_NUMBER}" to get the PR number
214214
4. Run: echo "${ADDITIONAL_INSTRUCTIONS}" to see any specific review
215215
instructions from the user
216-
5. Run: gh pr diff "${PR_NUMBER}" to see the full diff
216+
5. Run: gh pr diff "${PR_NUMBER}" to see the full diff and reference
217+
Context section to understand it
217218
6. For any specific files, use: cat filename, head -50 filename, or
218219
tail -50 filename
219220
7. If ADDITIONAL_INSTRUCTIONS contains text, prioritize those
@@ -291,7 +292,7 @@ jobs:
291292
* Security: Identify potential vulnerabilities (e.g., insecure storage, injection attacks,
292293
insufficient access controls).
293294
294-
### Miscellanous Considerations
295+
### Miscellaneous Considerations
295296
* Testing: Ensure adequate unit tests, integration tests, and end-to-end tests. Evaluate
296297
coverage, edge case handling, and overall test quality.
297298
* Performance: Assess performance under expected load, identify bottlenecks, and suggest
@@ -340,13 +341,47 @@ jobs:
340341
Keep comments bodies concise and to the point.
341342
Keep each comment focused on one issue.
342343
344+
## Context
345+
The files that are changed in this pull request are represented below in the following
346+
format, showing the file name and the portions of the file that are changed:
347+
348+
<PATCHES>
349+
FILE:<NAME OF FIRST FILE>
350+
DIFF:
351+
<PATCH IN UNIFIED DIFF FORMAT>
352+
353+
--------------------
354+
355+
FILE:<NAME OF SECOND FILE>
356+
DIFF:
357+
<PATCH IN UNIFIED DIFF FORMAT>
358+
359+
--------------------
360+
361+
(and so on for all files changed)
362+
</PATCHES>
363+
364+
Note that if you want to make a comment on the LEFT side of the UI / before the diff code version
365+
to note those line numbers and the corresponding code. Same for a comment on the RIGHT side
366+
of the UI / after the diff code version to note the line numbers and corresponding code.
367+
This should be your guide to picking line numbers, and also very importantly, restrict
368+
your comments to be only within this line range for these files, whether on LEFT or RIGHT.
369+
If you comment out of bounds, the review will fail, so you must pay attention the file name,
370+
line numbers, and pre/post diff versions when crafting your comment.
371+
372+
Here are the patches that were implemented in the pull request, per the
373+
formatting above:
374+
375+
The get the files changed in this pull request, run:
376+
"$(gh pr diff "${PR_NUMBER}" --patch)" to get the list of changed files PATCH
377+
343378
## Review
344379
345380
Once you have the information, provide a comprehensive code review by:
346381
1. Creating a pending review: Use the mcp__github__create_pending_pull_request_review to create a Pending Pull Request Review.
347382
348383
2. Adding review comments:
349-
2.1 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments. It is preferred to use code suggestions when possible, which include a code block that is labeled "suggestion", which contains what the new code should be. All comments should also have a piority. They syntax is:
384+
2.1 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments. It is preferred to use code suggestions when possible, which include a code block that is labeled "suggestion", which contains what the new code should be. All comments should also have a priority. They syntax is:
350385
Normal Comment Syntax:
351386
<COMMENT>
352387
{{PRIORITY}} {{COMMENT_TEXT}}
@@ -397,6 +432,7 @@ jobs:
397432
- Highlight positive aspects of the implementation
398433
- Note any recurring themes across files
399434
435+
400436
- name: 'Post PR review failure comment'
401437
if: |-
402438
${{ failure() && steps.gemini_pr_review.outcome == 'failure' }}

0 commit comments

Comments
 (0)