Skip to content

Commit 60d82cc

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 60d82cc

23 files changed

Lines changed: 2404 additions & 81 deletions
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Bug Report
2+
description: Report a bug to help us improve Gemini CLI on GitHub.
3+
labels: ['kind/bug', 'status/needs-triage']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
> [!IMPORTANT]
9+
> Thanks for taking the time to fill out this bug report!
10+
>
11+
> Please search **[existing issues](https://github.com/google-github-actions/run-gemini-cli/issues)** to see if an issue already exists for the bug you encountered.
12+
13+
- type: textarea
14+
id: problem
15+
attributes:
16+
label: What happened?
17+
description: A clear and concise description of what the bug is.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: expected
23+
attributes:
24+
label: What did you expect to happen?
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: additional-context
30+
attributes:
31+
label: Anything else we need to know?
32+
description: Add any other context about the problem here.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
labels: ['kind/enhancement', 'status/need-triage']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
> [!IMPORTANT]
9+
> Thanks for taking the time to suggest an enhancement!
10+
>
11+
> Please search **[existing issues](https://github.com/google-github-actions/run-gemini-cli/issues)** to see if a similar feature has already been requested.
12+
13+
- type: textarea
14+
id: feature
15+
attributes:
16+
label: What would you like to be added?
17+
description: A clear and concise description of the enhancement.
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: rationale
23+
attributes:
24+
label: Why is this needed?
25+
description: A clear and concise description of why this enhancement is needed.
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: additional-context
31+
attributes:
32+
label: Additional context
33+
description: Add any other context or screenshots about the feature request here.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: 🏷️ Gemini Automated Issue Triage
2+
3+
on:
4+
issues:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
triage-issue:
9+
timeout-minutes: 5
10+
permissions:
11+
issues: write
12+
contents: read
13+
id-token: write
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.issue.number }}
16+
cancel-in-progress: true
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Generate GitHub App Token
20+
id: generate_token
21+
if: ${{ vars.APP_ID }}
22+
uses: actions/create-github-app-token@v1
23+
with:
24+
app-id: ${{ vars.APP_ID }}
25+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
26+
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
token: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
31+
32+
- name: Run Gemini Issue Triage
33+
uses: ./
34+
env:
35+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
36+
ISSUE_TITLE: ${{ github.event.issue.title }}
37+
ISSUE_BODY: ${{ github.event.issue.body }}
38+
ISSUE_NUMBER: ${{ github.event.issue.number }}
39+
REPOSITORY: ${{ github.repository }}
40+
with:
41+
version: 0.1.8-rc.0
42+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
43+
OTLP_GCP_WIF_PROVIDER: ${{ secrets.OTLP_GCP_WIF_PROVIDER }}
44+
OTLP_GOOGLE_CLOUD_PROJECT: ${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}
45+
settings_json: |
46+
{
47+
"coreTools": [
48+
"run_shell_command(gh label list)",
49+
"run_shell_command(gh issue edit)"
50+
],
51+
"telemetry": {
52+
"enabled": true,
53+
"target": "gcp"
54+
},
55+
"sandbox": false
56+
}
57+
prompt: |
58+
You are an issue triage assistant. Analyze the current GitHub issue and apply the most appropriate existing labels.
59+
60+
Steps:
61+
1. Run: `gh label list` to get all available labels.
62+
2. Review the issue title and body provided in the environment variables.
63+
3. Select the most relevant labels from the existing labels. If available, set labels that follow the `kind/*`, `area/*`, and `priority/*` patterns.
64+
4. Apply the selected labels to this issue using: `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`
65+
5. If the `status/needs-triage` label is present, remove it using: `gh issue edit ISSUE_NUMBER --remove-label "status/needs-triage"`
66+
67+
Guidelines:
68+
- Only use labels that already exist in the repository.
69+
- Do not add comments or modify the issue content.
70+
- Triage only the current issue.
71+
- Assign all applicable labels based on the issue content.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: 📋 Gemini Scheduled Issue Triage
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *' # Runs every hour
6+
workflow_dispatch: {}
7+
8+
jobs:
9+
triage-issues:
10+
timeout-minutes: 10
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
15+
issues: write
16+
steps:
17+
- name: Generate GitHub App Token
18+
id: generate_token
19+
if: ${{ vars.APP_ID }}
20+
uses: actions/create-github-app-token@v1
21+
with:
22+
app-id: ${{ vars.APP_ID }}
23+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
24+
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
token: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
29+
30+
- name: Find untriaged issues
31+
id: find_issues
32+
env:
33+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
34+
run: |
35+
echo "🔍 Finding issues without labels..."
36+
NO_LABEL_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue no:label" --json number,title,body)
37+
38+
echo "🏷️ Finding issues that need triage..."
39+
NEED_TRIAGE_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue label:\"status/needs-triage\"" --json number,title,body)
40+
41+
echo "🔄 Merging and deduplicating issues..."
42+
ISSUES=$(echo "$NO_LABEL_ISSUES" "$NEED_TRIAGE_ISSUES" | jq -c -s 'add | unique_by(.number)')
43+
44+
echo "📝 Setting output for GitHub Actions..."
45+
echo "issues_to_triage=$ISSUES" >> "$GITHUB_OUTPUT"
46+
47+
echo "✅ Found $(echo "$ISSUES" | jq 'length') issues to triage! 🎯"
48+
49+
- name: Run Gemini Issue Triage
50+
if: steps.find_issues.outputs.issues_to_triage != '[]'
51+
uses: ./
52+
env:
53+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
54+
ISSUES_TO_TRIAGE: ${{ steps.find_issues.outputs.issues_to_triage }}
55+
REPOSITORY: ${{ github.repository }}
56+
with:
57+
version: 0.1.8-rc.0
58+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
59+
OTLP_GCP_WIF_PROVIDER: ${{ secrets.OTLP_GCP_WIF_PROVIDER }}
60+
OTLP_GOOGLE_CLOUD_PROJECT: ${{ secrets.OTLP_GOOGLE_CLOUD_PROJECT }}
61+
settings_json: |
62+
{
63+
"coreTools": [
64+
"run_shell_command(echo)",
65+
"run_shell_command(gh label list)",
66+
"run_shell_command(gh issue edit)",
67+
"run_shell_command(gh issue list)"
68+
],
69+
"telemetry": {
70+
"enabled": true,
71+
"target": "gcp"
72+
},
73+
"sandbox": false
74+
}
75+
prompt: |
76+
You are an issue triage assistant. Analyze issues and apply appropriate labels.
77+
78+
Steps:
79+
1. Run: `gh label list`
80+
2. Check environment variable: $ISSUES_TO_TRIAGE (JSON array of issues)
81+
3. For each issue, apply labels: `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`. If available, set labels that follow the `kind/*`, `area/*`, and `priority/*` patterns.
82+
4. For each issue, if the `status/needs-triage` label is present, remove it using: `gh issue edit ISSUE_NUMBER --remove-label "status/needs-triage"`
83+
84+
Guidelines:
85+
- Only use existing repository labels
86+
- Do not add comments
87+
- Triage each issue independently

0 commit comments

Comments
 (0)