Conversation
Signed-off-by: Abel Matos <matos.abel.g+github@gmail.com>
- the Issue Body should be moved to with: instead of env: because of the size limit. Signed-off-by: Abel Matos <matos.abel.g+github@gmail.com>
WalkthroughUpdates the Gemini review workflow to check out the PR’s merge ref and JSON-encode several inputs (title, body, additional context) using toJSON. No other steps or exported entities are changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions (PR event)
participant CO as actions/checkout
participant GR as Gemini Review Step
Dev->>GH: Open/Update PR
GH->>CO: Checkout repository (use PR merge ref)
note right of CO: Ensures merged state is reviewed
GH->>GR: Run review with inputs<br/>ISSUE_TITLE, ISSUE_BODY, ADDITIONAL_CONTEXT
note right of GR: Inputs are JSON-encoded via toJSON(...)
GR-->>GH: Post review results
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/gemini-review.yml (1)
43-44: Make checkout resilient when not running on a PR eventUsing the PR merge ref directly will fail if this reusable workflow is invoked without a pull_request/issue (PR) context. Add a safe fallback to
github.shato avoid checkout errors in non‑PR invocations.- ref: ${{ format('refs/pull/{0}/merge', github.event.pull_request.number || github.event.issue.number) }} + ref: ${{ (github.event.pull_request.number || github.event.issue.number) && format('refs/pull/{0}/merge', github.event.pull_request.number || github.event.issue.number) || github.sha }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/gemini-review.yml(1 hunks)
| GITHUB_TOKEN: '${{ steps.mint_identity_token.outputs.token || secrets.GITHUB_TOKEN || github.token }}' | ||
| ISSUE_TITLE: '${{ github.event.pull_request.title || github.event.issue.title }}' | ||
| ISSUE_BODY: '${{ github.event.pull_request.body || github.event.issue.body }}' | ||
| ISSUE_TITLE: '${{ toJSON(github.event.pull_request.title || github.event.issue.title) }}' |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Avoid JSON-encoding env vars (introduces extra quotes in values)
toJSON(...) wraps the string in quotes and escapes content, so downstream consumers may see literal quotes in the title. Use the raw string instead.
- ISSUE_TITLE: '${{ toJSON(github.event.pull_request.title || github.event.issue.title) }}'
+ ISSUE_TITLE: '${{ github.event.pull_request.title || github.event.issue.title }}'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ISSUE_TITLE: '${{ toJSON(github.event.pull_request.title || github.event.issue.title) }}' | |
| ISSUE_TITLE: '${{ github.event.pull_request.title || github.event.issue.title }}' |
🤖 Prompt for AI Agents
In .github/workflows/gemini-review.yml around line 51, the ISSUE_TITLE is being
set with toJSON(...) which JSON-encodes the title and introduces extra
quotes/escaping; replace the toJSON(...) expression with the raw string
expression (remove toJSON and pass github.event.pull_request.title ||
github.event.issue.title directly) so the environment variable receives the
unquoted title.
| ISSUE_TITLE: '${{ github.event.pull_request.title || github.event.issue.title }}' | ||
| ISSUE_BODY: '${{ github.event.pull_request.body || github.event.issue.body }}' | ||
| ISSUE_TITLE: '${{ toJSON(github.event.pull_request.title || github.event.issue.title) }}' | ||
| ISSUE_BODY: '${{ toJSON(github.event.pull_request.body || github.event.issue.body) }}' |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Avoid JSON-encoding env vars (introduces extra quotes in values)
Same issue for body: JSON-encoding will include surrounding quotes in the env var.
- ISSUE_BODY: '${{ toJSON(github.event.pull_request.body || github.event.issue.body) }}'
+ ISSUE_BODY: '${{ github.event.pull_request.body || github.event.issue.body }}'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ISSUE_BODY: '${{ toJSON(github.event.pull_request.body || github.event.issue.body) }}' | |
| ISSUE_BODY: '${{ github.event.pull_request.body || github.event.issue.body }}' |
🤖 Prompt for AI Agents
.github/workflows/gemini-review.yml around line 52: the environment variable
ISSUE_BODY is being set using toJSON(...) which JSON-encodes the string and adds
extra surrounding quotes; remove the toJSON wrapper and set ISSUE_BODY to the
raw expression instead (use ${{ github.event.pull_request.body ||
github.event.issue.body }} ), ensuring you preserve the fallback logic so the PR
body or issue body is used unquoted.
| PULL_REQUEST_NUMBER: '${{ github.event.pull_request.number || github.event.issue.number }}' | ||
| REPOSITORY: '${{ github.repository }}' | ||
| ADDITIONAL_CONTEXT: '${{ inputs.additional_context }}' | ||
| ADDITIONAL_CONTEXT: '${{ toJSON(inputs.additional_context) }}' |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Avoid JSON-encoding env vars (introduces extra quotes in values)
Pass additional_context as a plain string; JSON-encoding here is unnecessary and can degrade formatting.
- ADDITIONAL_CONTEXT: '${{ toJSON(inputs.additional_context) }}'
+ ADDITIONAL_CONTEXT: '${{ inputs.additional_context }}'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ADDITIONAL_CONTEXT: '${{ toJSON(inputs.additional_context) }}' | |
| ADDITIONAL_CONTEXT: '${{ inputs.additional_context }}' |
🤖 Prompt for AI Agents
.github/workflows/gemini-review.yml around line 55: the workflow currently sets
ADDITIONAL_CONTEXT using toJSON which JSON-encodes the input and adds extra
quotes/escaping; change it to pass the input directly as a plain string by
removing the toJSON call and assign ADDITIONAL_CONTEXT to the
inputs.additional_context expression so the value is not double-quoted or
escaped.
Summary by CodeRabbit