Skip to content

Commit e38529c

Browse files
Fixes typing issues and null check in github workflow (#9685)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: arii <342438+arii@users.noreply.github.com>
1 parent 0a128a1 commit e38529c

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/reusable-gemini-review.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ jobs:
398398
PR_DIFF_FILE: pr.diff
399399
FAILED_CHECKS_JSON: ${{ env.FAILED_CHECKS_JSON }}
400400
# Pass other context vars
401-
env:
402401
GEMINI_THOUGHT_SIGNATURE: ${{ needs.analyze-changes.outputs.thought-signature }}
403402
run: |
404403
pnpm tsx scripts/gemini-client.ts \
@@ -425,7 +424,7 @@ jobs:
425424
REVIEW_COMMENT=$(jq -r '.reviewComment // empty' review_result.json)
426425
427426
# Check if there's a comment to post
428-
if [ -n "$REVIEW_COMMENT" ]; then
427+
if [[ -n "$REVIEW_COMMENT" && "$REVIEW_COMMENT" != "null" ]]; then
429428
# Create the commit hash line
430429
COMMIT_HASH_MSG="> Reviewed commit: \`${HEAD_SHA}\`"
431430

scripts/gemini-client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,13 @@ export async function generateContentWithFallback({
340340
const text = result.response.text()
341341

342342
// Capture thought signature from the response if present
343-
const capturedSignature = (result.response.candidates?.[0] as any)?.thought_signature
343+
const capturedSignature = (
344+
result.response.candidates?.[0] as NonNullable<
345+
typeof result.response.candidates
346+
>[number] & {
347+
thought_signature?: string
348+
}
349+
)?.thought_signature
344350

345351
return { text, thoughtSignature: capturedSignature }
346352
} catch (error: unknown) {

0 commit comments

Comments
 (0)