Skip to content

Conversation

@huan
Copy link

@huan huan commented Nov 7, 2025

Fix the action error:

Installing Gemini CLI from npm: @google/gemini-cli@latest
Verifying installation:
0.13.0
Run set -euo pipefail
Error: Please set an Auth method in your /home/runner/.gemini/settings.json or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA

See: https://github.com/huan/ai-student-assistant/actions/runs/19178287968/job/54828468408#step:5:410

I ran into this issue today at DevFest Workshop Secure GitHub Workflow with Gemini CLI by Tianzi Cai & Rody Davis, Google.

Signed-off-by: Huan Li <huan@chatie.io>
Copilot AI review requested due to automatic review settings November 7, 2025 20:05
@huan huan requested review from a team as code owners November 7, 2025 20:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automatic configuration of the GOOGLE_GENAI_USE_VERTEXAI variable during the Workload Identity Federation setup process. This ensures that workflows using Vertex AI authentication will have the required variable set correctly.

  • Adds GOOGLE_GENAI_USE_VERTEXAI variable to the automated GitHub variable setup when the gh CLI is available

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

gh variable set GOOGLE_CLOUD_PROJECT --body "${GOOGLE_CLOUD_PROJECT}" --repo "${GITHUB_REPO}"
gh variable set GOOGLE_CLOUD_LOCATION --body "${GOOGLE_CLOUD_LOCATION}" --repo "${GITHUB_REPO}"
gh variable set SERVICE_ACCOUNT_EMAIL --body "${SERVICE_ACCOUNT_EMAIL}" --repo "${GITHUB_REPO}"
gh variable set GOOGLE_GENAI_USE_VERTEXAI --body "true" --repo "${GITHUB_REPO}"
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The new GOOGLE_GENAI_USE_VERTEXAI variable is set automatically when gh CLI is available, but it's not included in the manual setup instructions in the else block (lines 462-477). Users without the gh CLI won't know to set this variable manually. Consider adding documentation for this variable in the else block, similar to the other variables.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Author

Choose a reason for hiding this comment

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

solved.

@MJjainam
Copy link
Collaborator

@gemini-cli /review

@gemini-cli
Copy link

gemini-cli bot commented Nov 22, 2025

🤖 Hi @MJjainam, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link

@gemini-cli gemini-cli bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This Pull Request introduces a necessary fix by adding the GOOGLE_GENAI_USE_VERTEXAI variable to the setup script, which resolves an authentication error. The change is well-contained and directly addresses the reported issue.

🔍 General Feedback

  • The inclusion of echo statements for the newly set variable provides good visibility into the script's actions.
  • The overall approach aligns with the existing script's structure and conventions.

echo ""
echo "🤖 Variable Name: GOOGLE_GENAI_USE_VERTEXAI"
echo " Variable Value: true"
echo " (Set to 'true' to use Vertex AI, or use GOOGLE_GENAI_USE_GCA for Code Assist)"
Copy link

Choose a reason for hiding this comment

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

🟡 Consider clarifying how to 'use GOOGLE_GENAI_USE_GCA'. The current phrasing might imply setting GOOGLE_GENAI_USE_GCA to true, but it's not explicitly stated as it is for GOOGLE_GENAI_USE_VERTEXAI. Perhaps something like 'or set GOOGLE_GENAI_USE_GCA to 'true' for Code Assist'.

Suggested change
echo " (Set to 'true' to use Vertex AI, or use GOOGLE_GENAI_USE_GCA for Code Assist)"
echo " (Set to 'true' to use Vertex AI, or set GOOGLE_GENAI_USE_GCA to 'true' for Code Assist)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants