Skip to content

Commit 6850e24

Browse files
committed
feat: add documentation, workflows, and issue templates for Gemini CLI on GitHub
- Add comprehensive documentation in the docs/ directory for configuration, authentication, observability, issue triage, and PR review - Add example GitHub Actions workflows for automated issue triage, scheduled triage, and PR review using Gemini CLI - Add GitHub issue templates for bug reports and feature requests - Add scripts for setting up Google Cloud Workload Identity Federation and OpenTelemetry collector - Update .gitignore to include environment files, OS/IDE files, and Gemini CLI settings - Overhaul action.yml to support new inputs, telemetry, and improved installation logic - Update README.md and CONTRIBUTING.md with new usage and contribution guidelines
1 parent dac2fd4 commit 6850e24

34 files changed

+2423
-2685
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
version: 2
23
updates:
34
- package-ecosystem: 'npm'
@@ -7,4 +8,4 @@ updates:
78
interval: 'daily'
89
commit-message:
910
prefix: 'security: '
10-
open-pull-requests-limit: 0 # only check security updates
11+
open-pull-requests-limit: 0 # only check security updates

.github/workflows/draft-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
name: 'Draft release'
23

3-
on:
4+
on: # yamllint disable-line rule:truthy
45
workflow_dispatch:
56
inputs:
67
version_strategy:
@@ -19,7 +20,7 @@ permissions:
1920

2021
jobs:
2122
draft-release:
22-
uses: 'google-github-actions/.github/.github/workflows/draft-release.yml@v3' # ratchet:exclude
23+
uses: 'google-github-actions/.github/.github/workflows/draft-release.yml@v3' # ratchet:exclude
2324
with:
2425
version_strategy: '${{ github.event.inputs.version_strategy }}'
2526
secrets:
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: '🏷️ Gemini Automated Issue Triage'
3+
on: # yamllint disable-line rule:truthy
4+
issues:
5+
types:
6+
- 'opened'
7+
- 'reopened'
8+
9+
jobs:
10+
triage-issue:
11+
timeout-minutes: 5
12+
permissions:
13+
issues: 'write'
14+
contents: 'read'
15+
id-token: 'write'
16+
concurrency:
17+
group: '${{ github.workflow }}-${{ github.event.issue.number }}'
18+
# yamllint disable-line rule:truthy
19+
cancel-in-progress: true
20+
runs-on: 'ubuntu-latest'
21+
steps:
22+
- name: 'Generate GitHub App Token'
23+
id: 'generate_token'
24+
if: ${{ vars.APP_ID }}
25+
uses: 'actions/create-github-app-token@v1'
26+
with:
27+
app-id: '${{ vars.APP_ID }}'
28+
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
29+
30+
- name: 'Checkout repository'
31+
uses: 'actions/checkout@v4'
32+
with:
33+
token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
34+
35+
- name: 'Run Gemini Issue Triage'
36+
uses: './'
37+
env:
38+
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
39+
ISSUE_TITLE: '${{ github.event.issue.title }}'
40+
ISSUE_BODY: '${{ github.event.issue.body }}'
41+
ISSUE_NUMBER: '${{ github.event.issue.number }}'
42+
REPOSITORY: '${{ github.repository }}'
43+
with:
44+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
45+
otlp_gcp_wif_provider: '${{ secrets.OTLP_GCP_WIF_PROVIDER }}'
46+
otlp_google_cloud_project: '${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}'
47+
settings_json: |
48+
{
49+
"coreTools": [
50+
"run_shell_command(gh label list)",
51+
"run_shell_command(gh issue edit)"
52+
],
53+
"telemetry": {
54+
"enabled": true,
55+
"target": "gcp"
56+
},
57+
"sandbox": false
58+
}
59+
prompt: |
60+
You are an issue triage assistant. Analyze the current GitHub issue and apply the most
61+
appropriate existing labels.
62+
63+
Steps:
64+
1. Run: `gh label list` to get all available labels.
65+
2. Review the issue title and body provided in the environment variables.
66+
3. Select the most relevant labels from the existing labels. If available, set labels
67+
that follow the `kind/*`, `area/*`, and `priority/*` patterns.
68+
69+
4. Apply the selected labels to this issue using:
70+
`gh issue edit ISSUE_NUMBER --add-label "label1,label2"`
71+
5. If the `status/needs-triage` label is present, remove it using:
72+
`gh issue edit ISSUE_NUMBER --remove-label "status/needs-triage"`
73+
74+
Guidelines:
75+
- Only use labels that already exist in the repository.
76+
- Do not add comments or modify the issue content.
77+
- Triage only the current issue.
78+
- Assign all applicable labels based on the issue content.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
name: '📋 Gemini Scheduled Issue Triage'
3+
4+
on: # yamllint disable-line rule:truthy
5+
schedule:
6+
- cron: '0 * * * *' # Runs every hour
7+
workflow_dispatch:
8+
9+
jobs:
10+
triage-issues:
11+
timeout-minutes: 10
12+
runs-on: 'ubuntu-latest'
13+
permissions:
14+
contents: 'read'
15+
id-token: 'write'
16+
issues: 'write'
17+
steps:
18+
- name: 'Generate GitHub App Token'
19+
id: 'generate_token'
20+
if: ${{ vars.APP_ID }}
21+
uses: 'actions/create-github-app-token@v1'
22+
with:
23+
app-id: '${{ vars.APP_ID }}'
24+
private-key: '${{ secrets.APP_PRIVATE_KEY }}'
25+
26+
- name: 'Checkout repository'
27+
uses: 'actions/checkout@v4'
28+
with:
29+
token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
30+
31+
- name: 'Find untriaged issues'
32+
id: 'find_issues'
33+
env:
34+
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
35+
run: |
36+
echo '🔍 Finding issues without labels...'
37+
NO_LABEL_ISSUES=$(gh issue list --repo ${{ github.repository }} \
38+
--search 'is:open is:issue no:label' --json number,title,body)
39+
40+
echo '🏷️ Finding issues that need triage...'
41+
NEED_TRIAGE_ISSUES=$(gh issue list --repo ${{ github.repository }} \
42+
--search 'is:open is:issue label:"status/needs-triage"' --json number,title,body)
43+
44+
echo '🔄 Merging and deduplicating issues...'
45+
ISSUES=$(echo "$NO_LABEL_ISSUES" "$NEED_TRIAGE_ISSUES" | jq -c -s 'add | unique_by(.number)')
46+
47+
echo '📝 Setting output for GitHub Actions...'
48+
echo "issues_to_triage=$ISSUES" >> "$GITHUB_OUTPUT"
49+
50+
echo '✅ Found '$(echo "$ISSUES" | jq 'length')' issues to triage! 🎯'
51+
52+
- name: 'Run Gemini Issue Triage'
53+
if: steps.find_issues.outputs.issues_to_triage != '[]'
54+
uses: './'
55+
env:
56+
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token }}'
57+
ISSUES_TO_TRIAGE: '${{ steps.find_issues.outputs.issues_to_triage }}'
58+
REPOSITORY: '${{ github.repository }}'
59+
with:
60+
gemini_api_key: '${{ secrets.GEMINI_API_KEY }}'
61+
otlp_gcp_wif_provider: '${{ secrets.OTLP_GCP_WIF_PROVIDER }}'
62+
otlp_google_cloud_project: '${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}'
63+
settings_json: |
64+
{
65+
"coreTools": [
66+
"run_shell_command(echo)",
67+
"run_shell_command(gh label list)",
68+
"run_shell_command(gh issue edit)",
69+
"run_shell_command(gh issue list)"
70+
],
71+
"telemetry": {
72+
"enabled": true,
73+
"target": "gcp"
74+
},
75+
"sandbox": false
76+
}
77+
prompt: |
78+
You are an issue triage assistant. Analyze issues and apply appropriate labels.
79+
Steps:
80+
1. Run: `gh label list`
81+
2. Check environment variable: $ISSUES_TO_TRIAGE (JSON array of issues)
82+
3. For each issue, apply labels: `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`.
83+
If available, set labels that follow the `kind/*`, `area/*`, and `priority/*` patterns.
84+
4. For each issue, if the `status/needs-triage` label is present, remove it using:
85+
`gh issue edit ISSUE_NUMBER --remove-label "status/needs-triage"`
86+
Guidelines:
87+
- Only use existing repository labels
88+
- Do not add comments
89+
- Triage each issue independently

0 commit comments

Comments
 (0)