From 5553aded1ab8f82fca3dca99e334bf641255affb Mon Sep 17 00:00:00 2001 From: q4rk Date: Mon, 18 May 2026 23:25:12 +0000 Subject: [PATCH 1/6] Refactor review workflow to use local TOML command override with resolved variables --- .gemini/ci/pr-review/PROMPT.md | 70 ------------------- .gemini/commands/pr-code-review.toml.template | 32 +++++++++ .github/workflows/gemini-review.yml | 11 ++- 3 files changed, 37 insertions(+), 76 deletions(-) delete mode 100644 .gemini/ci/pr-review/PROMPT.md create mode 100644 .gemini/commands/pr-code-review.toml.template diff --git a/.gemini/ci/pr-review/PROMPT.md b/.gemini/ci/pr-review/PROMPT.md deleted file mode 100644 index f601f28..0000000 --- a/.gemini/ci/pr-review/PROMPT.md +++ /dev/null @@ -1,70 +0,0 @@ - - **GitHub Repository**: ${REPOSITORY} - **Pull Request Number**: ${PULL_REQUEST_NUMBER} - **Additional User Instructions**: ${ADDITIONAL_CONTEXT} - **Pull Review Details**: use `pull_request_read.get` tool to get the title, body, and metadata about the pull request. - **Code Changes**: call the `pull_request_read.get_diff` tool to retrieve the changes. - - - -The `code-review-commons` skill is ALREADY loaded and active. Proceed directly to analyzing the diffs using the `github` MCP tools. Then submit review following the exact structure and rules in the `` section. - - - -**Review Comment Formatting** - -- **Line Accuracy:** Ensure suggestions perfectly align with the line numbers and indentation of the code they are intended to replace. - - - Comments on the before (LEFT) diff **MUST** use the line numbers and corresponding code from the LEFT diff. - - - Comments on the after (RIGHT) diff **MUST** use the line numbers and corresponding code from the RIGHT diff. - -1. **Create Pending Review:** Call `create_pending_pull_request_review`. Ignore errors like "can only have one pending review per pull request" and proceed to the next step. - -2. **Add Comments and Suggestions:** For each formulated review comment, call `add_comment_to_pending_review`. - - 2a. For each suggested change, structure the comment payload using this exact template: - - - [{{SEVERITY}}] {{COMMENT_TEXT}} - - ```suggestion - {{CODE_SUGGESTION}} - ``` - - - 2b. When there is no code suggestion, structure the comment payload using this exact template: - - - [{{SEVERITY}}] {{COMMENT_TEXT}} - - -3. **Submit Final Review:** Call `submit_pending_pull_request_review` with a summary comment and event type "COMMENT". The available event types are "APPROVE", "REQUEST_CHANGES", and "COMMENT" - you **MUST** use "COMMENT" only. **DO NOT** use "APPROVE" or "REQUEST_CHANGES" event types. The summary comment **MUST** use this exact markdown format: - - ## 📋 Review Summary - - A brief, high-level assessment of the Pull Request's objective and quality (2-3 sentences). - - ## 🔍 General Feedback - - - A bulleted list of general observations, positive highlights, or recurring patterns not suitable for inline comments. - - Keep this section concise and do not repeat details already covered in inline comments. - - -# Pull Request Review Guidelines - -You are performing an automated Pull Request review for this repository. -To ensure high-quality, clean, and non-spammy feedback, you MUST strictly adhere to the following rules: - -## 1. Environment & Context -- The target repository name is provided in the `REPOSITORY` environment variable. -- The Pull Request number is provided in the `PULL_REQUEST_NUMBER` environment variable. -- When calling any GitHub MCP tools (such as `pull_request_read.get`, `pull_request_read.get_diff`, `create_pending_pull_request_review`, `add_comment_to_pending_review`, or `submit_pending_pull_request_review`), you MUST use these exact literal values: - - `repository`: "${REPOSITORY}" - - `pull_request_number`: ${PULL_REQUEST_NUMBER} (as a literal numeric integer, e.g. 11. You MUST pass it as a number, do NOT wrap it in quotes!) -- **CRITICAL:** Do NOT use placeholder variables, string templates (like `"$REPOSITORY"` or `"$PULL_REQUEST_NUMBER"`), or environment variable references inside your Python tool call arguments. You MUST resolve and pass the literal values directly. - -## 2. Anti-Spam Guardrail -- **CRITICAL:** First, fetch and read the Pull Request's existing review comments using `pull_request_read`. -- If an issue at a specific file and line has already been pointed out in a previous review comment, **do NOT post a duplicate comment**. -- You must suppress duplicate suggestions to prevent spamming the PR on synchronizing push events. Only post comments for newly introduced changes or unaddressed issues. \ No newline at end of file diff --git a/.gemini/commands/pr-code-review.toml.template b/.gemini/commands/pr-code-review.toml.template new file mode 100644 index 0000000..3a3d39f --- /dev/null +++ b/.gemini/commands/pr-code-review.toml.template @@ -0,0 +1,32 @@ +description = "Reviews the code changes in your pull request" +prompt = """ + + **GitHub Repository**: ${REPOSITORY} + **Pull Request Number**: ${PULL_REQUEST_NUMBER} + **Additional User Instructions**: ${ADDITIONAL_CONTEXT} + **Pull Review Details**: use `pull_request_read.get` tool to get the title, body, and metadata about the pull request. + **Code Changes**: call the `pull_request_read.get_diff` tool to retrieve the changes. + + + +The `code-review-commons` skill is ALREADY loaded and active. Proceed directly to analyzing the diffs using the `github` MCP tools. + + +# Pull Request Review Guidelines + +You are performing an automated Pull Request review for this repository. +To ensure high-quality, clean, and non-spammy feedback, you MUST strictly adhere to the following rules: + +## 1. Environment & Context +- The target repository name is provided in the `REPOSITORY` environment variable. +- The Pull Request number is provided in the `PULL_REQUEST_NUMBER` environment variable. +- When calling any GitHub MCP tools (such as `pull_request_read.get`, `pull_request_read.get_diff`, `create_pending_pull_request_review`, `add_comment_to_pending_review`, or `submit_pending_pull_request_review`), you MUST use these exact literal values: + - `repository`: "${REPOSITORY}" + - `pull_request_number`: ${PULL_REQUEST_NUMBER} (as a literal numeric integer. You MUST pass it as a number, do NOT wrap it in quotes!) +- **CRITICAL:** Do NOT use placeholder variables, string templates (like `"$REPOSITORY"` or `"$PULL_REQUEST_NUMBER"`), or environment variable references inside your Python tool call arguments. You MUST resolve and pass the literal values directly. + +## 2. Anti-Spam Guardrail +- **CRITICAL:** First, fetch and read the Pull Request's existing review comments using `pull_request_read`. +- If an issue at a specific file and line has already been pointed out in a previous review comment, **do NOT post a duplicate comment**. +- You must suppress duplicate suggestions to prevent spamming the PR on synchronizing push events. Only post comments for newly introduced changes or unaddressed issues. +""" diff --git a/.github/workflows/gemini-review.yml b/.github/workflows/gemini-review.yml index a12a531..9258d98 100644 --- a/.github/workflows/gemini-review.yml +++ b/.github/workflows/gemini-review.yml @@ -41,15 +41,15 @@ jobs: run: | python3 -c ' import os - content = open("PROMPT.md").read() + content = open("../../commands/pr-code-review.toml.template").read() content = content.replace("${REPOSITORY}", os.environ["REPOSITORY"]) content = content.replace("${PULL_REQUEST_NUMBER}", os.environ["PULL_REQUEST_NUMBER"]) content = content.replace("${ADDITIONAL_CONTEXT}", os.environ.get("ADDITIONAL_CONTEXT", "")) - open("PROMPT_RESOLVED.md", "w").write(content) + open("../../commands/pr-code-review.toml", "w").write(content) ' - echo "=== DEBUG: PROMPT_RESOLVED.md ===" - cat PROMPT_RESOLVED.md + echo "=== DEBUG: pr-code-review.toml ===" + cat ../../commands/pr-code-review.toml echo "==================================" { @@ -59,8 +59,7 @@ jobs: echo "EOF" echo "prompt< Date: Mon, 18 May 2026 23:25:24 +0000 Subject: [PATCH 2/6] Add bad code for review --- another_bad_file.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 another_bad_file.py diff --git a/another_bad_file.py b/another_bad_file.py new file mode 100644 index 0000000..ab47a15 --- /dev/null +++ b/another_bad_file.py @@ -0,0 +1,10 @@ +import sqlite3 + +def get_user_data(username): + conn = sqlite3.connect('users.db') + cursor = conn.cursor() + query = f"SELECT * FROM users WHERE username = '{username}'" + cursor.execute(query) + return cursor.fetchall() + +unused_var = 10 From af3c7e3064abf714a534190a595e1304b337503c Mon Sep 17 00:00:00 2001 From: q4rk Date: Mon, 18 May 2026 23:27:39 +0000 Subject: [PATCH 3/6] Fix ADDITIONAL_CONTEXT fallback to None --- .github/workflows/gemini-review.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gemini-review.yml b/.github/workflows/gemini-review.yml index 9258d98..f17a57a 100644 --- a/.github/workflows/gemini-review.yml +++ b/.github/workflows/gemini-review.yml @@ -44,7 +44,10 @@ jobs: content = open("../../commands/pr-code-review.toml.template").read() content = content.replace("${REPOSITORY}", os.environ["REPOSITORY"]) content = content.replace("${PULL_REQUEST_NUMBER}", os.environ["PULL_REQUEST_NUMBER"]) - content = content.replace("${ADDITIONAL_CONTEXT}", os.environ.get("ADDITIONAL_CONTEXT", "")) + add_ctx = os.environ.get("ADDITIONAL_CONTEXT", "").strip() + if not add_ctx: + add_ctx = "None" + content = content.replace("${ADDITIONAL_CONTEXT}", add_ctx) open("../../commands/pr-code-review.toml", "w").write(content) ' From dc62f2dc3b72c66b2a4c1700c49e092e856049d2 Mon Sep 17 00:00:00 2001 From: q4rk Date: Mon, 18 May 2026 23:49:55 +0000 Subject: [PATCH 4/6] last --- .../pr-review/PROMPT.md} | 17 +-- .github/workflows/gemini-dispatch.yml | 141 ------------------ .github/workflows/gemini-review.yml | 97 ++++++------ 3 files changed, 49 insertions(+), 206 deletions(-) rename .gemini/{commands/pr-code-review.toml.template => ci/pr-review/PROMPT.md} (54%) delete mode 100644 .github/workflows/gemini-dispatch.yml diff --git a/.gemini/commands/pr-code-review.toml.template b/.gemini/ci/pr-review/PROMPT.md similarity index 54% rename from .gemini/commands/pr-code-review.toml.template rename to .gemini/ci/pr-review/PROMPT.md index 3a3d39f..4453eff 100644 --- a/.gemini/commands/pr-code-review.toml.template +++ b/.gemini/ci/pr-review/PROMPT.md @@ -1,11 +1,7 @@ -description = "Reviews the code changes in your pull request" -prompt = """ - **GitHub Repository**: ${REPOSITORY} - **Pull Request Number**: ${PULL_REQUEST_NUMBER} - **Additional User Instructions**: ${ADDITIONAL_CONTEXT} - **Pull Review Details**: use `pull_request_read.get` tool to get the title, body, and metadata about the pull request. - **Code Changes**: call the `pull_request_read.get_diff` tool to retrieve the changes. + **GitHub Repository**: ${REPOSITORY} + **Pull Request Number**: ${PULL_REQUEST_NUMBER} + **Additional User Instructions**: ${ADDITIONAL_CONTEXT} @@ -20,13 +16,12 @@ To ensure high-quality, clean, and non-spammy feedback, you MUST strictly adhere ## 1. Environment & Context - The target repository name is provided in the `REPOSITORY` environment variable. - The Pull Request number is provided in the `PULL_REQUEST_NUMBER` environment variable. -- When calling any GitHub MCP tools (such as `pull_request_read.get`, `pull_request_read.get_diff`, `create_pending_pull_request_review`, `add_comment_to_pending_review`, or `submit_pending_pull_request_review`), you MUST use these exact literal values: +- When calling any GitHub MCP tools, you MUST use these exact literal values: - `repository`: "${REPOSITORY}" - `pull_request_number`: ${PULL_REQUEST_NUMBER} (as a literal numeric integer. You MUST pass it as a number, do NOT wrap it in quotes!) -- **CRITICAL:** Do NOT use placeholder variables, string templates (like `"$REPOSITORY"` or `"$PULL_REQUEST_NUMBER"`), or environment variable references inside your Python tool call arguments. You MUST resolve and pass the literal values directly. +- **CRITICAL:** Do NOT use placeholder variables or string templates inside your Python tool call arguments. ## 2. Anti-Spam Guardrail - **CRITICAL:** First, fetch and read the Pull Request's existing review comments using `pull_request_read`. - If an issue at a specific file and line has already been pointed out in a previous review comment, **do NOT post a duplicate comment**. -- You must suppress duplicate suggestions to prevent spamming the PR on synchronizing push events. Only post comments for newly introduced changes or unaddressed issues. -""" +- You must suppress duplicate suggestions to prevent spamming the PR on synchronizing push events. Only post comments for newly introduced changes or unaddressed issues. \ No newline at end of file diff --git a/.github/workflows/gemini-dispatch.yml b/.github/workflows/gemini-dispatch.yml deleted file mode 100644 index 8215133..0000000 --- a/.github/workflows/gemini-dispatch.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: "Gemini Dispatch" - -on: - pull_request_review_comment: - types: - - "created" - pull_request_review: - types: - - "submitted" - pull_request: - types: - - "opened" - issues: - types: - - 'opened' - - 'reopened' - issue_comment: - types: - - 'created' - -defaults: - run: - shell: "bash" - -jobs: - debugger: - if: |- - ${{ fromJSON(vars.GEMINI_DEBUG || vars.ACTIONS_STEP_DEBUG || false) }} - runs-on: "ubuntu-latest" - permissions: - contents: "read" - steps: - - name: "Print context for debugging" - env: - DEBUG_event_name: "${{ github.event_name }}" - DEBUG_event__action: "${{ github.event.action }}" - DEBUG_event__comment__author_association: "${{ github.event.comment.author_association }}" - DEBUG_event__issue__author_association: "${{ github.event.issue.author_association }}" - DEBUG_event__pull_request__author_association: "${{ github.event.pull_request.author_association }}" - DEBUG_event__review__author_association: "${{ github.event.review.author_association }}" - DEBUG_event: "${{ toJSON(github.event) }}" - run: |- - env | grep '^DEBUG_' - - dispatch: - # For PRs: only if not from a fork - # For issues: only on open/reopen - # For comments: only if user types @gemini-cli and is OWNER/MEMBER/COLLABORATOR - if: |- - ( - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.fork == false - ) || ( - github.event_name == 'issues' && - contains(fromJSON('["opened", "reopened"]'), github.event.action) - ) || ( - github.event.sender.type == 'User' && - startsWith(github.event.comment.body || github.event.review.body || github.event.issue.body, '@gemini-cli') && - contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association || github.event.review.author_association || github.event.issue.author_association) - ) - runs-on: "ubuntu-latest" - permissions: - contents: "read" - issues: "write" - pull-requests: "write" - outputs: - command: "${{ steps.extract_command.outputs.command }}" - request: "${{ steps.extract_command.outputs.request }}" - additional_context: "${{ steps.extract_command.outputs.additional_context }}" - issue_number: "${{ github.event.pull_request.number || github.event.issue.number }}" - steps: - - name: "Extract command" - id: "extract_command" - uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # ratchet:actions/github-script@v7 - env: - EVENT_TYPE: "${{ github.event_name }}.${{ github.event.action }}" - REQUEST: "${{ github.event.comment.body || github.event.review.body || github.event.issue.body }}" - with: - script: | - const eventType = process.env.EVENT_TYPE; - const request = process.env.REQUEST; - core.setOutput('request', request); - - if (eventType === 'pull_request.opened') { - core.setOutput('command', 'review'); - } else if (request.startsWith("@gemini-cli /review")) { - core.setOutput('command', 'review'); - const additionalContext = request.replace(/^@gemini-cli \/review/, '').trim(); - core.setOutput('additional_context', additionalContext); - } else { - core.setOutput('command', 'fallthrough'); - } - - - name: "Acknowledge request" - env: - GITHUB_TOKEN: "${{github.token }}" - ISSUE_NUMBER: "${{ github.event.pull_request.number || github.event.issue.number }}" - MESSAGE: |- - 🤖 Hi @${{ github.actor }}, I've received your request, and I'm working on it now! You can track my progress [in the logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details. - REPOSITORY: "${{ github.repository }}" - run: |- - gh issue comment "${ISSUE_NUMBER}" \ - --body "${MESSAGE}" \ - --repo "${REPOSITORY}" - - review: - needs: "dispatch" - if: |- - ${{ needs.dispatch.outputs.command == 'review' }} - uses: "./.github/workflows/gemini-review.yml" - permissions: - contents: "read" - issues: "write" - pull-requests: "write" - with: - additional_context: "${{ needs.dispatch.outputs.additional_context }}" - secrets: "inherit" - - fallthrough: - needs: - - "dispatch" - - "review" - if: |- - ${{ always() && !cancelled() && (failure() || needs.dispatch.outputs.command == 'fallthrough') }} - runs-on: "ubuntu-latest" - permissions: - contents: "read" - issues: "write" - pull-requests: "write" - steps: - - name: "Send failure comment" - env: - GITHUB_TOKEN: "${{ github.token }}" - ISSUE_NUMBER: "${{ github.event.pull_request.number || github.event.issue.number }}" - MESSAGE: |- - 🤖 I'm sorry @${{ github.actor }}, but I was unable to process your request. Please [see the logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details. - REPOSITORY: "${{ github.repository }}" - run: |- - gh issue comment "${ISSUE_NUMBER}" \ - --body "${MESSAGE}" \ - --repo "${REPOSITORY}" diff --git a/.github/workflows/gemini-review.yml b/.github/workflows/gemini-review.yml index f17a57a..f07ebaa 100644 --- a/.github/workflows/gemini-review.yml +++ b/.github/workflows/gemini-review.yml @@ -1,95 +1,84 @@ -name: 'Gemini Review' +name: 'Gemini PR Review' on: - workflow_call: - inputs: - additional_context: - type: 'string' - description: 'Any additional context from the request' - required: false - + pull_request: + types: [opened, synchronize] + issue_comment: + types: [created] + concurrency: - group: '${{ github.workflow }}-review-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.issue.number }}' + group: '${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }}' cancel-in-progress: true permissions: contents: read pull-requests: write - -defaults: - run: - shell: 'bash' + issues: write jobs: review: + # Only run on PRs (not forks) OR on PR comments starting with the command from authorized users + if: >- + (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) || + (github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '@gemini-cli /review') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: persist-credentials: false - ref: refs/pull/${{ github.event.pull_request.number || github.event.issue.number }}/head fetch-depth: 0 - - name: Load Gemini Configurations for PR Review + - name: Acknowledge Command (Reaction) + if: github.event_name == 'issue_comment' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api -X POST /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions -f content='eyes' + + - name: Extract Context & Load Configs id: config working-directory: .gemini/ci/pr-review env: REPOSITORY: ${{ github.repository }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} - ADDITIONAL_CONTEXT: ${{ inputs.additional_context }} + RAW_COMMENT: ${{ github.event.comment.body || '' }} run: | - python3 -c ' - import os - content = open("../../commands/pr-code-review.toml.template").read() - content = content.replace("${REPOSITORY}", os.environ["REPOSITORY"]) - content = content.replace("${PULL_REQUEST_NUMBER}", os.environ["PULL_REQUEST_NUMBER"]) - add_ctx = os.environ.get("ADDITIONAL_CONTEXT", "").strip() - if not add_ctx: - add_ctx = "None" - content = content.replace("${ADDITIONAL_CONTEXT}", add_ctx) - open("../../commands/pr-code-review.toml", "w").write(content) - ' - - echo "=== DEBUG: pr-code-review.toml ===" - cat ../../commands/pr-code-review.toml - echo "==================================" - + ADDITIONAL_CONTEXT="None" + if [[ "$RAW_COMMENT" == *"@gemini-cli /review"* ]]; then + ADDITIONAL_CONTEXT=$(echo "$RAW_COMMENT" | sed 's/^@gemini-cli \/review//' | xargs) + [ -z "$ADDITIONAL_CONTEXT" ] && ADDITIONAL_CONTEXT="None" + fi + + # Export variables so envsubst can access them + export REPOSITORY PULL_REQUEST_NUMBER ADDITIONAL_CONTEXT + { - echo "settings<> "$GITHUB_OUTPUT" - - name: Run Gemini CLI for PR Review + - name: Run Gemini CLI uses: google-github-actions/run-gemini-cli@v0.1.22 env: - GEMINI_CLI_TRUST_WORKSPACE: true + GEMINI_CLI_TRUST_WORKSPACE: 'true' 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 }}' GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} REPOSITORY: ${{ github.repository }} PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} - ADDITIONAL_CONTEXT: '${{ inputs.additional_context }}' with: gemini_api_key: ${{ secrets.GEMINI_API_KEY }} - workflow_name: 'gemini-review' - gemini_cli_version: 'latest' gemini_model: 'gemini-2.5-flash' - # Explicitly set the PR number to handle `issue_comment` triggers (which GitHub treats as issues, not PRs) - github_pr_number: '${{ github.event.pull_request.number }}' + github_pr_number: ${{ github.event.pull_request.number || github.event.issue.number }} prompt: ${{ steps.config.outputs.prompt }} settings: ${{ steps.config.outputs.settings }} - extensions: ${{ steps.config.outputs.extensions }} - gemini_debug: '${{ fromJSON(vars.GEMINI_DEBUG || vars.ACTIONS_STEP_DEBUG || true) }}' \ No newline at end of file + extensions: ${{ steps.config.outputs.extensions }} \ No newline at end of file From 692c5ce7e3f2673065ea12205784c39af09fa2c1 Mon Sep 17 00:00:00 2001 From: q4rk Date: Mon, 18 May 2026 23:51:21 +0000 Subject: [PATCH 5/6] cap --- .github/workflows/gemini-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gemini-review.yml b/.github/workflows/gemini-review.yml index f07ebaa..285c6ff 100644 --- a/.github/workflows/gemini-review.yml +++ b/.github/workflows/gemini-review.yml @@ -63,7 +63,7 @@ jobs: echo "EOF_DELIM" echo "prompt<> "$GITHUB_OUTPUT" From 7adb8cbf90086ea8ba2af027756b86ef70143326 Mon Sep 17 00:00:00 2001 From: q4rk Date: Mon, 18 May 2026 23:53:00 +0000 Subject: [PATCH 6/6] new --- .github/workflows/gemini-review.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gemini-review.yml b/.github/workflows/gemini-review.yml index 285c6ff..b7e0dc0 100644 --- a/.github/workflows/gemini-review.yml +++ b/.github/workflows/gemini-review.yml @@ -44,6 +44,7 @@ jobs: PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }} RAW_COMMENT: ${{ github.event.comment.body || '' }} run: | + # 1. Extract additional context from the comment (if any) ADDITIONAL_CONTEXT="None" if [[ "$RAW_COMMENT" == *"@gemini-cli /review"* ]]; then ADDITIONAL_CONTEXT=$(echo "$RAW_COMMENT" | sed 's/^@gemini-cli \/review//' | xargs) @@ -53,17 +54,21 @@ jobs: # Export variables so envsubst can access them export REPOSITORY PULL_REQUEST_NUMBER ADDITIONAL_CONTEXT + # 2. Safely read files and set GitHub Outputs { echo "settings<> "$GITHUB_OUTPUT"