From 9a7b42dea52f3e974401f85d87f3c4d326366b27 Mon Sep 17 00:00:00 2001 From: jothi Date: Tue, 13 Jan 2026 09:18:16 +0000 Subject: [PATCH] Update .github/workflows/gemini-pr-review.yaml --- .github/workflows/gemini-pr-review.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gemini-pr-review.yaml b/.github/workflows/gemini-pr-review.yaml index 80a833b..0abbca2 100644 --- a/.github/workflows/gemini-pr-review.yaml +++ b/.github/workflows/gemini-pr-review.yaml @@ -5,15 +5,20 @@ name: Gemini PR Review on: pull_request: types: [opened, reopened, synchronize] - workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - review: + gemini-pr-review: runs-on: ubuntu-latest + name: Gemini PR Review + steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # This fetches the full history @@ -22,7 +27,6 @@ jobs: with: node-version: '24' - - name: Get npm cache directory id: npm-cache-dir run: | @@ -36,8 +40,14 @@ jobs: restore-keys: | ${{ runner.os }}-npm-global- -# - name: Install Gemini CLI globally -# run: npm install -g --loglevel=http @google/gemini-cli + - name: Install Gemini CLI globally (if not already installed) + run: | + if ! command -v gemini &> /dev/null; then + echo "Gemini CLI not found, installing..." + npm install -g --loglevel=http @google/gemini-cli + else + echo "Gemini CLI already installed." + fi - name: Generate git diff and review with Gemini id: review @@ -52,7 +62,6 @@ jobs: cat /tmp/gemini-client-error*.json || true - - name: Post output to PR comment id: post_comment run: | -- 2.49.1