6363 )
6464 timeout-minutes : 15
6565 runs-on : ' ubuntu-latest'
66-
6766 steps :
6867 - name : ' Checkout PR code'
6968 uses : ' actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # ratchet:actions/checkout@v4
@@ -143,6 +142,7 @@ jobs:
143142
144143 - name : ' Run Gemini PR Review'
145144 uses : ' ./'
145+ # Define the common env block ONCE using an anchor
146146 env :
147147 GITHUB_TOKEN : ' ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
148148 PR_NUMBER : ' ${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}'
@@ -154,6 +154,9 @@ jobs:
154154 OTLP_GOOGLE_CLOUD_PROJECT : ' ${{ vars.OTLP_GOOGLE_CLOUD_PROJECT }}'
155155 OTLP_GCP_WIF_PROVIDER : ' ${{ vars.OTLP_GCP_WIF_PROVIDER }}'
156156 GEMINI_API_KEY : ' ${{ secrets.GEMINI_API_KEY }}'
157+ GOOGLE_CLOUD_PROJECT : ' ${{ vars.GOOGLE_CLOUD_PROJECT }}'
158+ GOOGLE_CLOUD_LOCATION : ' ${{ vars.GOOGLE_CLOUD_LOCATION }}'
159+ GOOGLE_GENAI_USE_VERTEXAI : ' ${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
157160 with :
158161 settings_json : |-
159162 {
@@ -176,7 +179,6 @@ jobs:
176179 }
177180 prompt : |-
178181 ## Role
179-
180182 You are an expert code reviewer. You have access to tools to gather
181183 PR information and perform the review. Use the available tools to
182184 gather information; do not ask for information to be provided.
@@ -188,14 +190,14 @@ jobs:
188190 2. Run: echo "${CHANGED_FILES}" to get the list of changed files
189191 3. Run: echo "${PR_NUMBER}" to get the PR number
190192 4. Run: echo "${ADDITIONAL_INSTRUCTIONS}" to see any specific review
191- instructions from the user
193+ instructions from the user
192194 5. Run: gh pr diff "${PR_NUMBER}" to see the full diff
193195 6. For any specific files, use: cat filename, head -50 filename, or
194- tail -50 filename
196+ tail -50 filename
195197 7. If ADDITIONAL_INSTRUCTIONS contains text, prioritize those
196- specific areas or focus points in your review. Common instruction
197- examples: "focus on security", "check performance", "review error
198- handling", "check for breaking changes"
198+ specific areas or focus points in your review. Common instruction
199+ examples: "focus on security", "check performance", "review error
200+ handling", "check for breaking changes"
199201
200202
201203 ## Guidelines
@@ -210,9 +212,9 @@ jobs:
210212
211213 Once you have the information, provide a comprehensive code review by:
212214 1. Writing your review to a file: write_file("review.md", "<your
213- detailed review feedback here>")
215+ detailed review feedback here>")
214216 2. Posting the review: gh pr comment "${PR_NUMBER}" --body-file
215- review.md --repo "${REPOSITORY}"
217+ review.md --repo "${REPOSITORY}"
216218
217219 Review Areas:
218220 - **Security**: Authentication, authorization, input validation,
0 commit comments