Commit df6eba2
authored
fix(action): Unset empty gemini_api_key environment variable (#127)
GitHub Actions defaults to passing an empty string for optional inputs
that are not explicitly set in a workflow. When the `gemini_api_key`
input is unset, it is passed as an empty string to the `GEMINI_API_KEY`
environment variable.
The Gemini CLI does not handle an empty `GEMINI_API_KEY` variable
gracefully, which can lead to unexpected behavior.
This commit addresses the issue by explicitly checking if the
`GEMINI_API_KEY` variable is empty (`-z`). If it is, the variable is
unset before invoking the Gemini CLI. This ensures the CLI's default
authentication behavior (e.g., using Application Default Credentials) is
triggered correctly when no API key is provided, improving the action's
robustness and predictability.
>Note: This is a temporary workaround to unblock users. The underlying
issue of handling empty string inputs will be addressed with improved
validation in the Gemini CLI upstream.
Fixes:
#1231 parent 7d94f07 commit df6eba2
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
143 | 150 | | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
0 commit comments