feat: Initial implementation of the Gemini CLI GitHub Action#1
feat: Initial implementation of the Gemini CLI GitHub Action#1
Conversation
60d82cc to
f441560
Compare
|
@bradegler as the resident bash wizard, can you take a pass on this please? |
7103670 to
728be25
Compare
This commit introduces the core implementation of the Gemini CLI GitHub Action, establishing its primary features and structure. Key features and additions include: - **Composite Action:** The action is built as a composite action, directly installing and running the Gemini CLI for efficiency and simplicity. - **Workflows:** Includes example workflows for key use cases: - Automated and scheduled issue triage. - Pull request reviews. - **Documentation:** Comprehensive documentation is added for: - Configuration and setup. - Authentication using GitHub Apps and Google Cloud Workload Identity Federation. - Observability with OpenTelemetry. - **Scripts:** Helper scripts are provided to facilitate the setup of Workload Identity and OpenTelemetry. - **Project Files:** - `action.yml` is configured with inputs for the CLI. - `README.md`, `CONTRIBUTING.md`, and `GEMINI.md` provide usage and contribution guidelines.
bradegler
left a comment
There was a problem hiding this comment.
The bash contained in this PR looks good.
There was a problem hiding this comment.
📋 Review Summary
This pull request introduces the initial implementation of the run-gemini-cli GitHub Action. The action is well-structured as a composite action and includes comprehensive documentation and example workflows for common use cases like issue triage and pull request reviews.
🔍 General Feedback
- The use of composite actions is a good choice for performance and simplicity.
- The documentation is well-written and provides clear instructions for users.
- The example workflows are very helpful for getting started with the action.
- The telemetry and observability features are a great addition.
- The most critical issue is the removal of tests for the action. Without tests, it is difficult to ensure the correctness and stability of the action.
| } | ||
|
|
||
| try { | ||
| return JSON.parse(content); |
There was a problem hiding this comment.
🟡 The getJson, downloadFile, and ensureBinary functions use shell commands like curl, unzip, and tar directly. While this works in the GitHub Actions environment, it would be more robust and platform-independent to use Node.js libraries for these tasks, such as node-fetch for downloading and tar or decompress for extraction. This would also improve error handling.
There was a problem hiding this comment.
📋 Review Summary
This is an excellent pull request that refactors the action to be a composite action. This change simplifies the codebase and improves maintainability. The addition of comprehensive documentation, examples, and helper scripts for setup is a huge improvement for the user experience.
🔍 General Feedback
- The move to a composite action is a great decision.
- The new documentation is clear and comprehensive.
- The example workflows are very helpful for users.
I have only a few minor suggestions for improvement, which I have added as comments.
There was a problem hiding this comment.
This pull request introduces a comprehensive set of workflows and documentation for the Gemini CLI GitHub Action. The changes are well-structured and provide a solid foundation for the project. The review includes some suggestions to improve the robustness and maintainability of the action and its workflows.
## 🔍 General Feedback
- The use of composite actions is a great choice for this project, making it lightweight and fast.
- The documentation is clear and provides good examples for users to get started.
- The workflows for issue triage and pull request review are well-designed and will be very useful.
</SUMMARY>
| VERSION_INPUT="${GEMINI_CLI_VERSION:-latest}" | ||
|
|
||
| if [[ "$VERSION_INPUT" == "latest" || "$VERSION_INPUT" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.-]+)?(\+[a-zA-Z0-9\.-]+)?$ ]]; then | ||
| echo "Installing Gemini CLI from npm: @google/gemini-cli@$VERSION_INPUT" |
There was a problem hiding this comment.
```suggestion
gemini --prompt "${PROMPT}"
```
</COMMENT>
| echo "pr_data=${PR_DATA}" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| # Get file changes | ||
| CHANGED_FILES="$(gh pr diff "${PR_NUMBER}" --name-only)" |
There was a problem hiding this comment.
```suggestion
uses: 'google-github-actions/run-gemini-cli@main'
```
</COMMENT>
| using: 'composite' | ||
| steps: | ||
| - name: 'Configure Gemini CLI' | ||
| if: |- |
There was a problem hiding this comment.
```suggestion
uses: 'google-github-actions/auth@v3'
```
</COMMENT>
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: 'PR number to review' |
There was a problem hiding this comment.
```suggestion
group: '${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}'
```
</COMMENT>
| fileExists, | ||
| waitForPort, | ||
| ensureBinary, | ||
| } from './telemetry_utils.js'; |
There was a problem hiding this comment.
| console.log('🧹 Cleaning up old processes and logs...'); | ||
| try { | ||
| execSync('pkill -f "otelcol-contrib"'); | ||
| console.log('✅ Stopped existing collector process.'); |
There was a problem hiding this comment.
This commit introduces the core implementation of the Gemini CLI GitHub Action, establishing its primary features and structure.
Key features:
action.ymlis configured with inputs for the CLI.README.md,CONTRIBUTING.md, andGEMINI.mdprovide usage and contribution guidelines.