Skip to content

Commit 8ec664a

Browse files
authored
Use v0 tag for human-facing docs, consistent YAML (#93)
This won't work until we cut a `@v0` floating alias, but we can do that at any time. We want to make sure people aren't pinning to `@main` (from experience). This also moves the workflows from the root into an `examples/` directory, which is more expected.
1 parent 1c6b9e9 commit 8ec664a

18 files changed

+77
-69
lines changed

.github/workflows/gemini-cli.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ permissions:
2929
jobs:
3030
gemini-cli:
3131
# This condition is complex to ensure we only run when explicitly invoked.
32-
if: |
32+
if: |-
3333
github.event_name == 'workflow_dispatch' ||
3434
(
3535
github.event_name == 'issues' && github.event.action == 'opened' &&
@@ -200,7 +200,7 @@ jobs:
200200
} >> "${GITHUB_OUTPUT}"
201201
202202
- name: 'Set up git user for commits'
203-
run: |
203+
run: |-
204204
git config --global user.name 'gemini-cli[bot]'
205205
git config --global user.email 'gemini-cli[bot]@users.noreply.github.com'
206206
@@ -226,7 +226,7 @@ jobs:
226226
- name: 'Create new branch for issue'
227227
if: |-
228228
${{ steps.get_context.outputs.is_pr == 'false' }}
229-
run: |
229+
run: |-
230230
set -euo pipefail
231231
BRANCH_NAME="gemini-issue-${{ steps.get_context.outputs.issue_number }}"
232232
git checkout -b "${BRANCH_NAME}"
@@ -239,7 +239,7 @@ jobs:
239239
ISSUE_NUMBER: '${{ steps.get_context.outputs.issue_number }}'
240240
REPOSITORY: '${{ github.repository }}'
241241
REQUEST_TYPE: '${{ steps.get_context.outputs.request_type }}'
242-
run: |
242+
run: |-
243243
set -euo pipefail
244244
MESSAGE=""
245245
case "${REQUEST_TYPE}" in
@@ -285,7 +285,7 @@ jobs:
285285
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
286286
use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
287287
use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}'
288-
settings: |
288+
settings: |-
289289
{
290290
"maxSessionTurns": 50,
291291
"coreTools": [

.github/workflows/gemini-issue-automated-triage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
121121
with:
122122
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
123-
script: |
123+
script: |-
124124
github.rest.issues.createComment({
125125
owner: '${{ github.repository }}'.split('/')[0],
126126
repo: '${{ github.repository }}'.split('/')[1],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ jobs:
403403
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea'
404404
with:
405405
github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
406-
script: |
406+
script: |-
407407
github.rest.issues.createComment({
408408
owner: '${{ github.repository }}'.split('/')[0],
409409
repo: '${{ github.repository }}'.split('/')[1],

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Cloud product, please contact [Google Cloud support].**
3535

3636
## Features
3737

38-
- **Automation**: Trigger workflows based on events (e.g. issue opening) or schedules (e.g. nightly).
38+
- **Automation**: Trigger workflows based on events (e.g. issue opening) or schedules (e.g. nightly).
3939
- **On-demand Collaboration**: Trigger workflows in issue and pull request
4040
comments by mentioning the [Gemini CLI] (e.g., `@gemini-cli /review`).
4141
- **Extensible with Tools**: Leverage [Gemini] models' tool-calling capabilities to
@@ -61,16 +61,19 @@ You have two options to set up a workflow:
6161

6262
**Option A: Use setup command (Recommended)**
6363
1. Start the Gemini CLI:
64-
```bash
64+
65+
```shell
6566
gemini
6667
```
68+
6769
2. In the chat interface, type:
70+
6871
```
6972
/setup-github
7073
```
7174

72-
**Option B: Manually copy workflows**
73-
1. Copy the pre-built workflows from the [`/workflows`](./workflows) directory to your repository's `.github/workflows` directory.
75+
**Option B: Manually copy workflows**
76+
1. Copy the pre-built workflows from the [`examples/workflows`](./examples/workflows) directory to your repository's `.github/workflows` directory.
7477

7578
### 4. Try it out!
7679

@@ -98,20 +101,20 @@ This action provides several pre-built workflows for different use cases. Each w
98101

99102
This action can be used to triage GitHub Issues automatically or on a schedule.
100103
For a detailed guide on how to set up the issue triage system, go to the
101-
[GitHub Issue Triage workflow documentation](./workflows/issue-triage).
104+
[GitHub Issue Triage workflow documentation](./examples/workflows/issue-triage).
102105

103106
### Pull Request Review
104107

105108
This action can be used to automatically review pull requests when they are
106109
opened. For a detailed guide on how to set up the pull request review system,
107-
go to the [GitHub PR Review workflow documentation](./workflows/pr-review).
110+
go to the [GitHub PR Review workflow documentation](./examples/workflows/pr-review).
108111

109112
### Gemini CLI Assistant
110113

111114
This type of action can be used to invoke a general-purpose, conversational Gemini
112115
AI assistant within the pull requests and issues to perform a wide range of
113116
tasks. For a detailed guide on how to set up the general-purpose Gemini CLI workflow,
114-
go to the [Gemini CLI workflow documentation](./workflows/gemini-cli).
117+
go to the [Gemini CLI workflow documentation](./examples/workflows/gemini-cli).
115118

116119
### Inputs
117120

@@ -166,7 +169,7 @@ We recommend setting the following values as repository variables so they can be
166169
| `APP_ID` | GitHub App ID for custom authentication. | Variable | No | Using a custom GitHub App |
167170

168171

169-
To add a repository variable:
172+
To add a repository variable:
170173
1) Go to your repository's **Settings > Secrets and variables > Actions > New variable**.
171174
2) Enter the variable name and value.
172175
3) Save.
@@ -183,16 +186,17 @@ You can set the following secrets in your repository:
183186
| `APP_PRIVATE_KEY` | Private key for your GitHub App (PEM format). | No | Using a custom GitHub App. |
184187

185188
To add a secret:
186-
1) Go to your repository's **Settings > Secrets and variables >Actions > New repository secret**.
187-
2) Enter the secret name and value.
188-
3) Save.
189+
190+
1. Go to your repository's **Settings > Secrets and variables >Actions > New repository secret**.
191+
2. Enter the secret name and value.
192+
3. Save.
189193

190194
For more information, refer to the
191195
[official GitHub documentation on creating and using encrypted secrets][secrets].
192196

193197
## Authentication
194198

195-
This action requires authentication to both Google services (for Gemini AI) and the GitHub API.
199+
This action requires authentication to both Google services (for Gemini AI) and the GitHub API.
196200

197201
### Google Authentication
198202

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ description: |-
1919
2020
inputs:
2121
prompt:
22-
description: |
22+
description: |-
2323
A string passed to the Gemini CLI's [`--prompt` argument](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#command-line-arguments).
2424
required: false
2525
default: 'You are a helpful assistant.'
2626
settings:
27-
description: |
27+
description: |-
2828
A JSON string written to `.gemini/settings.json` to configure the CLI's _project_ settings.
2929
For more details, see the documentation on [settings files](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md#settings-files).
3030
required: false
@@ -67,7 +67,7 @@ runs:
6767
- name: 'Configure Gemini CLI'
6868
if: |-
6969
${{ inputs.settings != '' }}
70-
run: |
70+
run: |-
7171
mkdir -p .gemini/
7272
echo "${SETTINGS}" > ".gemini/settings.json"
7373
shell: 'bash'
@@ -138,7 +138,7 @@ runs:
138138
139139
- name: 'Run Gemini CLI'
140140
id: 'gemini_run'
141-
run: |
141+
run: |-
142142
set -e
143143
GEMINI_RESPONSE=$(gemini --yolo --prompt "${PROMPT}")
144144
# Set the captured response as a step output, supporting multiline

docs/authentication.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ This is the simplest method and is suitable for projects that do not require Goo
4949
#### Example
5050

5151
```yaml
52-
- uses: google-github-actions/run-gemini-cli@main
52+
- uses: 'google-github-actions/run-gemini-cli@v0'
5353
with:
54-
prompt: "Explain this code"
55-
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
54+
prompt: |-
55+
Explain this code
56+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
5657
```
5758
5859
### Method 2: Authenticating with Google Cloud
@@ -92,7 +93,7 @@ Your user account needs these permissions in the target GCP project to run the s
9293
Basic setup for your repository:
9394

9495
```shell
95-
./scripts/setup_workload_identity.sh --repo OWNER/REPO --project GOOGLE_CLOUD_PROJECT
96+
./scripts/setup_workload_identity.sh --repo "[OWNER]/[REPO]" --project "[GOOGLE_CLOUD_PROJECT]"
9697
```
9798

9899
**Required Parameters:**
@@ -102,7 +103,7 @@ Basic setup for your repository:
102103
For example:
103104

104105
```shell
105-
./scripts/setup_workload_identity.sh --repo google/my-repo --project my-project
106+
./scripts/setup_workload_identity.sh --repo "my-github-org/my-github-repo" --project "my-gcp-project"
106107
```
107108

108109
**Usage**
@@ -160,14 +161,15 @@ After running the `setup_workload_identity.sh` script, add the following variabl
160161
**Example**
161162

162163
```yaml
163-
- uses: google-github-actions/run-gemini-cli@main
164+
- uses: 'google-github-actions/run-gemini-cli@v0'
164165
with:
165166
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
166167
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
167168
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
168169
gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}'
169170
use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}'
170-
prompt: 'Explain this code'
171+
prompt: |-
172+
Explain this code
171173
```
172174
173175
#### Connecting to Gemini Code Assist
@@ -193,14 +195,15 @@ After running the `setup_workload_identity.sh` script, add the following variabl
193195
**Example**
194196

195197
```yaml
196-
- uses: google-github-actions/run-gemini-cli@main
198+
- uses: 'google-github-actions/run-gemini-cli@v0'
197199
with:
198200
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
199201
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
200202
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
201203
gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}'
202204
use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}'
203-
prompt: 'Explain this code'
205+
prompt: |-
206+
Explain this code
204207
```
205208

206209
## GitHub Authentication
@@ -218,10 +221,10 @@ If the `APP_ID` and `APP_PRIVATE_KEY` secrets are not configured in your reposit
218221
* **Limited Permissions:** The `GITHUB_TOKEN` has a restricted set of permissions. You may need to grant additional permissions directly within your workflow file to enable specific functionalities, such as:
219222

220223
```yaml
221-
permissions:
222-
contents: read
223-
issues: write
224-
pull-requests: write
224+
permissions:
225+
contents: 'read'
226+
issues: 'write'
227+
pull-requests: 'write'
225228
```
226229

227230
* **Job-Scoped:** The token's access is limited to the repository where the workflow is running and expires when the job is complete.
@@ -244,7 +247,7 @@ For optimal security and control, we strongly recommend creating a custom GitHub
244247
> **Note:** Always adhere to the principle of least privilege. If your custom workflows require fewer permissions, adjust these settings accordingly.
245248
5. Click **Create GitHub App**.
246249

247-
A manifest is also available at `custom_app_manifest.yml`. For details on registering a GitHub App from a manifest, see the [GitHub documentation](https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest).
250+
An example manifest is also available at [`examples/github-app/custom_app_manifest.yml`](../examples/github-app/custom_app_manifest.yml). For details on registering a GitHub App from a manifest, see the [GitHub documentation](https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest).
248251

249252
#### Step 2: Generate a Private Key and Get the App ID
250253

docs/observability.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The action uses its own built-in telemetry system that ensures consistent and re
1919

2020
The Gemini CLI Action integrates OpenTelemetry to provide comprehensive observability for your workflows. This includes:
2121

22-
- **Metrics**: Monitor performance indicators and usage statistics
22+
- **Metrics**: Monitor performance indicators and usage statistics
2323
- **Logs**: Capture detailed information for debugging and analysis
2424
- **Traces**: Track the execution flow and timing of operations
2525

@@ -30,7 +30,7 @@ Before enabling observability, ensure you have:
3030
- A Google Cloud project with billing enabled
3131
- Completed authentication setup (see [Authentication documentation](./authentication.md))
3232
- The following APIs enabled in your GCP project:
33-
- Cloud Monitoring API
33+
- Cloud Monitoring API
3434
- Cloud Logging API
3535
- Cloud Trace API
3636

@@ -49,13 +49,13 @@ environment.
4949
After running the setup script, configure your GitHub Actions workflow with the provided values:
5050

5151
```yaml
52-
- uses: google-github-actions/run-gemini-cli@main
52+
- uses: 'google-github-actions/run-gemini-cli@v0'
5353
with:
54-
gcp_workload_identity_provider: ${{ vars.GCP_WIF_PROVIDER }}
55-
gcp_project_id: ${{ vars.GOOGLE_CLOUD_PROJECT }}
56-
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
54+
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
55+
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
56+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
5757
# Enable telemetry in settings
58-
settings: |
58+
settings: |-
5959
{
6060
"telemetry": {
6161
"enabled": true,
@@ -86,29 +86,30 @@ The action automatically handles the setup of the OpenTelemetry (OTel) collector
8686
```yaml
8787
jobs:
8888
review:
89-
runs-on: ubuntu-latest
89+
runs-on: 'ubuntu-latest'
9090
steps:
91-
- uses: google-github-actions/run-gemini-cli@main
91+
- uses: 'google-github-actions/run-gemini-cli@v0'
9292
with:
93-
gcp_workload_identity_provider: ${{ vars.GCP_WIF_PROVIDER }}
94-
gcp_service_account: ${{ vars.SERVICE_ACCOUNT_EMAIL }}
95-
gcp_project_id: ${{ vars.GOOGLE_CLOUD_PROJECT }}
96-
settings: |
93+
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
94+
gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}'
95+
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
96+
settings: |-
9797
{
9898
"telemetry": {
9999
"enabled": true,
100100
"target": "gcp"
101101
}
102102
}
103-
prompt: "Review this pull request"
103+
prompt: |-
104+
Review this pull request
104105
```
105106
106107
## Disabling
107108
108109
If you prefer to disable OpenTelemetry, you can explicitly opt out by setting `enabled: false` in your settings:
109110

110111
```yaml
111-
- uses: google-github-actions/run-gemini-cli@main
112+
- uses: 'google-github-actions/run-gemini-cli@v0'
112113
with:
113114
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
114115
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
@@ -127,7 +128,7 @@ If you prefer to disable OpenTelemetry, you can explicitly opt out by setting `e
127128
Alternatively, you can omit the `telemetry` settings entirely, as telemetry is disabled by default:
128129

129130
```yaml
130-
- uses: google-github-actions/run-gemini-cli@main
131+
- uses: 'google-github-actions/run-gemini-cli@v0'
131132
with:
132133
gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}'
133134
gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}'
@@ -149,7 +150,7 @@ Alternatively, you can omit the `telemetry` settings entirely, as telemetry is d
149150
**Permission errors:**
150151
- Verify your service account has these roles:
151152
- `roles/logging.logWriter`
152-
- `roles/monitoring.editor`
153+
- `roles/monitoring.editor`
153154
- `roles/cloudtrace.agent`
154155

155156
For additional troubleshooting guidance, see the [Authentication documentation](./authentication.md).

workflows/README.md renamed to examples/workflows/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This directory contains a collection of example workflows that demonstrate how t
2323

2424
## Setup
2525

26-
For detailed setup instructions, including prerequisites and authentication, please refer to the main [Authentication documentation](../docs/authentication.md).
26+
For detailed setup instructions, including prerequisites and authentication, please refer to the main [Authentication documentation](../../docs/authentication.md).
2727

2828
To use a workflow, you can utilize either of the following steps:
2929
- Run the `/setup-github` command in Gemini CLI on your terminal to set up workflows for your repository.
@@ -57,7 +57,7 @@ Add the following to your workflow YAML file to set a custom value:
5757

5858
```yaml
5959
with:
60-
settings: |
60+
settings: |-
6161
{
6262
"maxSessionTurns": 10
6363
}
File renamed without changes.

0 commit comments

Comments
 (0)