google-github-actions / google-github-actions/run-gemini-cli
Refactor logic out of YAML/Bash and into a TypeScript package
Open
@parthasaradhie is already working on this.
Since Nov 25, 2025.
area/quality
area/telemetry
area/tools
area/workflows
github_actions
kind/enhancement
- Dominant language
- TypeScript
- Stars
- 2.1k
- Forks
- 285
- Avg merge
- 8h 8m
- Merged PRs (30d)
- 1
Description
Description:
The action.yml currently contains significant amounts of complex logic embedded directly within bash run steps. This approach makes the action difficult to test, maintain, and debug. Refactoring this logic into a dedicated TypeScript package will improve code quality, enable proper unit testing, and enhance reusability.
Specific areas for refactoring:
- Input Validation Logic: The
Validate Inputsstep contains extensive conditional logic for validating authentication methods and input combinations. This should be moved into a TypeScript module. - Gemini CLI Installation Logic: The
Install Gemini CLIstep handles different installation methods based on thegemini_cli_version. This logic, including npm and git operations, should be encapsulated in a TypeScript function. - Gemini CLI Execution and Output Handling: The
Run Gemini CLIstep manages the execution of the Gemini CLI, captures its stdout/stderr, and handles error conditions. The output parsing and error reporting could be made more robust and testable in a TypeScript module. - Telemetry Upload Logic: The
Upload Telemetry to Google Cloudstep involves Docker commands, file manipulation, and a polling mechanism. This complex sequence should be refactored into a dedicated TypeScript module for better testability and maintainability.
Acceptance Criteria:
- All identified complex bash logic is replaced with calls to functions within a new TypeScript package.
- The
action.ymlremains focused on orchestrating steps rather than implementing detailed logic. - A clear project structure for the TypeScript package is established (e.g.,
src/,dist/,package.json).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.