Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/gemini-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ jobs:

- name: 'Checkout repository'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
with:
ref: ${{ format('refs/pull/{0}/merge', github.event.pull_request.number || github.event.issue.number) }}

- name: 'Run Gemini pull request review'
uses: 'google-github-actions/run-gemini-cli@main' # ratchet:exclude
id: 'gemini_pr_review'
env:
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) }}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

Suggested change
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_BODY: '${{ toJSON(github.event.pull_request.body || github.event.issue.body) }}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

Suggested change
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) }}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

Suggested change
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.

with:
gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}'
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
Expand Down