You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor action to use inputs instead of environment variables (#65)
This commit refactors the GitHub Action to use explicit inputs instead
of environment variables for configuration. This change improves the
usability and clarity of the action by making all configuration options
visible in the workflow file.
Key changes:
- action.yml: Replaced environment variable references with new inputs
for Gemini API key, GCP project ID, CLI version, and other settings.
- README.md: Updated documentation to reflect the new input-based
configuration and updated the environment variable section.
- Workflows: Updated all example workflows to use the new inputs.
Fixes#28@sethvargo PTAL
-[Observability with OpenTelemetry](#observability-with-opentelemetry)
26
-
-[OpenTelemetry in Google Cloud](#opentelemetry-in-google-cloud)
27
26
-[Customization](#customization)
28
27
-[Contributing](#contributing)
29
28
@@ -47,8 +46,7 @@ Before using the Gemini CLI GitHub Action, make sure to:
47
46
48
47
## Configuration
49
48
50
-
The Gemini CLI GitHub Action is configured via a combination of workflow inputs, outputs,
51
-
environment variables, and secrets.
49
+
The Gemini CLI GitHub Action is configured via workflow inputs and secrets.
52
50
53
51
### Inputs
54
52
@@ -59,6 +57,22 @@ environment variables, and secrets.
59
57
- <aname="settings"></a><ahref="#user-content-settings"><code>settings</code></a>: _(Optional)_ A JSON string written to `.gemini/settings.json` to configure the CLI's _project_ settings.
60
58
For more details, see the documentation on [settings files](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#settings-files).
61
59
60
+
- <aname="gemini_api_key"></a><ahref="#user-content-gemini_api_key"><code>gemini_api_key</code></a>: _(Optional)_ The API key for the Gemini API.
61
+
62
+
- <aname="gcp_project_id"></a><ahref="#user-content-gcp_project_id"><code>gcp_project_id</code></a>: _(Optional)_ The Google Cloud project ID.
63
+
64
+
- <aname="gcp_location"></a><ahref="#user-content-gcp_location"><code>gcp_location</code></a>: _(Optional)_ The Google Cloud location.
65
+
66
+
- <aname="gcp_workload_identity_provider"></a><ahref="#user-content-gcp_workload_identity_provider"><code>gcp_workload_identity_provider</code></a>: _(Optional)_ The Google Cloud Workload Identity Provider.
67
+
68
+
- <aname="gcp_service_account"></a><ahref="#user-content-gcp_service_account"><code>gcp_service_account</code></a>: _(Optional)_ The Google Cloud service account email.
69
+
70
+
- <aname="use_vertex_ai"></a><ahref="#user-content-use_vertex_ai"><code>use_vertex_ai</code></a>: _(Optional, default: `false`)_ A flag to indicate if Vertex AI should be used.
71
+
72
+
- <aname="use_gemini_code_assist"></a><ahref="#user-content-use_gemini_code_assist"><code>use_gemini_code_assist</code></a>: _(Optional, default: `false`)_ A flag to indicate if Gemini Code Assist should be used.
73
+
74
+
- <aname="gemini_cli_version"></a><ahref="#user-content-gemini_cli_version"><code>gemini_cli_version</code></a>: _(Optional, default: `latest`)_ The version of the Gemini CLI to install.
75
+
62
76
63
77
<!-- END_AUTOGEN_INPUTS -->
64
78
@@ -73,35 +87,48 @@ environment variables, and secrets.
73
87
74
88
### Environment Variables
75
89
76
-
Set the following environment variables in your repository or workflow:
90
+
You can set the following environment variables in your repository:
91
+
92
+
| Name | Description | Type | Required | When Required |
| GEMINI_CLI_VERSION | Controls which version of the Gemini CLI is installed. Supports `npm` versions (e.g., `0.1.0`, `latest`), a branch name (e.g., `main`), or a commit hash. | Variable | No | To pin or override the CLI version |
81
-
| GCP_WIF_PROVIDER | Full resource name of the Workload Identity Provider. | Variable | No | When using observability |
82
-
| OTLP_GOOGLE_CLOUD_PROJECT | Google Cloud project for telemetry. | Variable | No | When using observability |
83
-
| GOOGLE_CLOUD_PROJECT | Google Cloud project for Vertex AI authentication. | Variable | No | When using Vertex AI authentication |
84
-
| GOOGLE_CLOUD_LOCATION | Geographic location of the Google Cloud project for Vertex AI authentication. | Variable | No | When using Vertex AI authentication |
85
-
| GOOGLE_GENAI_USE_VERTEXAI | Set to 'true' to use Vertex AI | Variable | No | When using Vertex AI authentication |
86
-
| APP_ID | GitHub App ID for custom authentication. | Variable | No | When using a custom GitHub App |
87
109
110
+
To add an environment variable:
111
+
1) Go to your repository's **Settings > Secrets and variables > Actions > New variable**.
112
+
2) Enter the variable name and value.
113
+
3) Save.
88
114
89
-
To add an environment variable: 1) Go to your repository's **Settings > Secrets and
90
-
variables > Actions > New variable**; 2) Enter the variable name and value; and 3) Save.
91
-
For organization-wide or environment-specific variables, refer to the
92
-
[GitHub documentation on variables][variables].
115
+
For organization-wide or environment-specific variables, refer to the [GitHub documentation on variables][variables].
93
116
94
117
### Secrets
95
118
96
-
The following secrets are required for security:
119
+
You can set the following secrets in your repository:
Copy file name to clipboardExpand all lines: action.yml
+39-12Lines changed: 39 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,33 @@ inputs:
28
28
A JSON string written to `.gemini/settings.json` to configure the CLI's _project_ settings.
29
29
For more details, see the documentation on [settings files](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#settings-files).
30
30
required: false
31
+
gemini_api_key:
32
+
description: 'The API key for the Gemini API.'
33
+
required: false
34
+
gcp_project_id:
35
+
description: 'The Google Cloud project ID.'
36
+
required: false
37
+
gcp_location:
38
+
description: 'The Google Cloud location.'
39
+
required: false
40
+
gcp_workload_identity_provider:
41
+
description: 'The Google Cloud Workload Identity Provider.'
42
+
required: false
43
+
gcp_service_account:
44
+
description: 'The Google Cloud service account email.'
45
+
required: false
46
+
use_vertex_ai:
47
+
description: 'A flag to indicate if Vertex AI should be used.'
48
+
required: false
49
+
default: 'false'
50
+
use_gemini_code_assist:
51
+
description: 'A flag to indicate if Gemini Code Assist should be used.'
52
+
required: false
53
+
default: 'false'
54
+
gemini_cli_version:
55
+
description: 'The version of the Gemini CLI to install.'
0 commit comments