Skip to content

Commit fc048eb

Browse files
authored
feat: reorganize examples and docs into workflows (#20)
This commit reorganizes the project structure by moving the `examples` and `docs` directories into a new `workflows` directory. This change improves the organization of the project and makes it easier to find and contribute to the available workflows. The `workflows` directory now contains a `README.md` file that provides an overview of the available workflows and encourages community contributions. The main `README.md` file has been updated to reflect the new directory structure.
1 parent 561f95b commit fc048eb

9 files changed

Lines changed: 63 additions & 17 deletions

File tree

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Cloud product, please contact [Google Cloud support].**
1818
- [Outputs](#outputs)
1919
- [Environment Variables](#environment-variables)
2020
- [Secrets](#secrets)
21-
- [Usage and Examples](#usage-and-examples)
22-
- [Issue Triage](#issue-triage)
23-
- [Pull Request Review](#pull-request-review)
21+
- [Workflows](#workflows)
22+
- [Issue Triage](#issue-triage)
23+
- [Pull Request Review](#pull-request-review)
24+
- [Generic Gemini CLI](#generic-gemini-cli)
2425
- [Authentication](#authentication)
2526
- [Observability with OpenTelemetry](#observability-with-opentelemetry)
2627
- [OpenTelemetry in Google Cloud](#opentelemetry-in-google-cloud)
@@ -99,32 +100,39 @@ To add a secret, go to your repository's **Settings > Secrets and variables >
99100
Actions > New repository secret**. For more information, see the
100101
[official GitHub documentation on creating and using encrypted secrets][secrets].
101102

102-
## Usage and Examples
103+
## Workflows
103104

104105
To use this action, create a workflow file in your repository (e.g.,
105106
`.github/workflows/gemini.yml`).
106107

107108
The best way to get started is to copy one of the pre-built workflows from the
108-
[`/examples`](./examples) directory into your project's `.github/workflows`
109+
[`/workflows`](./workflows) directory into your project's `.github/workflows`
109110
folder and customize it.
110111

111112
See the sections below for specific examples.
112113

113-
## Issue Triage
114+
### Issue Triage
114115

115116
This action can be used to triage GitHub issues automatically or on a schedule.
116117
For a detailed guide on how to set up the issue triage system, please see the
117-
[**Issue Triage documentation**](./docs/issue-triage.md).
118+
[documentation](./workflows/issue-triage).
118119

119-
## Pull Request Review
120+
### Pull Request Review
120121

121122
This action can be used to automatically review pull requests when they are
122123
opened. Additionally, users with `OWNER`, `MEMBER`, or `COLLABORATOR`
123124
permissions can trigger a review by commenting `@gemini-cli /review` in a pull
124125
request.
125126

126127
For a detailed guide on how to set up the pull request review system, please see
127-
the [**Pull Request Review documentation**](./docs/pr-review.md).
128+
the [documentation](./workflows/pr-review).
129+
130+
### Generic Gemini CLI
131+
132+
This action can be used to invoke a general-purpose, conversational AI assistant
133+
that can be invoked within pull requests and issues to perform a wide range of
134+
tasks. For a detailed guide on how to set up the Gemini CLI, please see the
135+
[documentation](./workflows/gemini-cli).
128136

129137
## Authentication
130138

workflows/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Gemini CLI Workflows
2+
3+
This directory contains a collection of example workflows that demonstrate how to use the [Google Gemini CLI GitHub Action](https://github.com/google-github-actions/run-gemini-cli). These workflows are designed to be reusable and customizable for your own projects.
4+
5+
## Available Workflows
6+
7+
* **[Issue Triage](./issue-triage)**: Automatically triage GitHub issues using Gemini. This workflow can be configured to run on a schedule or be triggered by issue events.
8+
* **[Pull Request Review](./pr-review)**: Automatically review pull requests using Gemini. This workflow can be triggered by pull request events and provides a comprehensive review of the changes.
9+
* **[Gemini CLI](./gemini-cli)**: A general-purpose, conversational AI assistant that can be invoked within pull requests and issues to perform a wide range of tasks.
10+
11+
## Contributing
12+
13+
We encourage you to contribute to this collection of workflows! If you have a workflow that you would like to share with the community, please open a pull request.
14+
15+
When contributing, please follow these guidelines. For more information on contributing to the project as a whole, please see the [CONTRIBUTING.md](../../CONTRIBUTING.md) file.
16+
17+
* Create a new directory for your workflow.
18+
* Include a `README.md` file that explains how to use your workflow.
19+
* Add your workflow to the list of available workflows in this `README.md` file.
20+
21+
We look forward to seeing what you build!
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ When invoked with `@gemini-cli`, the assistant uses a customizable set of tools
4949

5050
### Workflow File
5151

52-
Copy the example workflow file from `examples/gemini-cli.yml` to `.github/workflows/gemini-cli.yml` in your repository.
52+
Create the necessary directories and download the example workflow file into your repository's `.github/workflows` directory.
53+
54+
```bash
55+
mkdir -p .github/workflows
56+
curl -o .github/workflows/gemini-cli.yml https://raw.githubusercontent.com/google-github-actions/run-gemini-cli/main/workflows/gemini-cli/gemini-cli.yml
57+
```
58+
Alternatively, you can manually copy the contents of the workflow file from this repository into the corresponding file in your own repository.
5359

5460
## Usage
5561

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
--repo "${REPOSITORY}"
166166
167167
- name: 'Run Gemini'
168-
uses: './'
168+
uses: 'google-github-actions/run-gemini-cli@main'
169169
env:
170170
GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}'
171171
REPOSITORY: '${{ github.repository }}'
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ The two workflows work together to ensure that all new and existing issues are t
4949

5050
To implement this issue triage system in your repository, you will need to do the following:
5151

52-
1. **Create the Workflows**: Copy the example workflow files into your repository's `.github/workflows` directory.
52+
1. **Create the Workflow Files**: Create the necessary directories and download the example workflow files into `.github/workflows` directory in your repository.
5353

54-
* `examples/gemini-issue-automated-triage.yml`
55-
* `examples/gemini-issue-scheduled-triage.yml`
54+
```bash
55+
mkdir -p .github/workflows
56+
curl -o .github/workflows/gemini-issue-automated-triage.yml https://raw.githubusercontent.com/google-github-actions/run-gemini-cli/main/workflows/issue-triage/gemini-issue-automated-triage.yml
57+
curl -o .github/workflows/gemini-issue-scheduled-triage.yml https://raw.githubusercontent.com/google-github-actions/run-gemini-cli/main/workflows/issue-triage/gemini-issue-scheduled-triage.yml
58+
```
59+
60+
Alternatively, you can manually copy the contents of the workflow files from this repository into the corresponding files in your own repository.
5661

5762
2. **Configure Secrets**: The workflows require secrets for authentication. You will need to create the following secrets in your repository's settings:
5863

@@ -66,8 +71,8 @@ To implement this issue triage system in your repository, you will need to do th
6671

6772
### Real-Time Issue Triage
6873

69-
This workflow is defined in `examples/gemini-issue-automated-triage.yml` and is triggered when an issue is opened or reopened. It uses the Gemini CLI to analyze the issue and apply relevant labels.
74+
This workflow is defined in `workflows/issue-triage/gemini-issue-automated-triage.yml` and is triggered when an issue is opened or reopened. It uses the Gemini CLI to analyze the issue and apply relevant labels.
7075

7176
### Scheduled Issue Triage
7277

73-
This workflow is defined in `examples/gemini-issue-scheduled-triage.yml` and runs on a schedule (e.g., every hour). It finds any issues that have no labels or have the `status/needs-triage` label and then uses the Gemini CLI to triage them. This workflow can also be manually triggered.
78+
This workflow is defined in `workflows/issue-triage/gemini-issue-scheduled-triage.yml` and runs on a schedule (e.g., every hour). It finds any issues that have no labels or have the `status/needs-triage` label and then uses the Gemini CLI to triage them. This workflow can also be manually triggered.
File renamed without changes.
File renamed without changes.
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ The PR Review workflow uses Google's Gemini AI to provide comprehensive code rev
5555

5656
### Workflow File
5757

58-
Copy the workflow file to `.github/workflows/gemini-pr-review.yml` in your repository. The workflow is already configured and ready to use.
58+
Create the necessary directories and download the example workflow file into your repository's `.github/workflows` directory.
59+
60+
```bash
61+
mkdir -p .github/workflows
62+
curl -o .github/workflows/gemini-pr-review.yml https://raw.githubusercontent.com/google-github-actions/run-gemini-cli/main/workflows/pr-review/gemini-pr-review.yml
63+
```
64+
Alternatively, you can manually copy the contents of the workflow file from this repository into the corresponding file in your own repository.
5965

6066
## Usage
6167

0 commit comments

Comments
 (0)