Skip to content

Conversation

@jerop
Copy link
Contributor

@jerop jerop commented Aug 25, 2025

The dispatch pattern was implemented for dogfooding in this repository by @sethvargo in #212

This is change is mostly coping over workflows in https://github.com/google-github-actions/run-gemini-cli/tree/main/.github/workflows and adding the relevant updates to documentation


This commit refactors the GitHub Actions workflows to use a central dispatch model and significantly improves the documentation.

The gemini-dispatch workflow is introduced to act as a single entry point, routing commands to the appropriate reusable workflow (review, triage, or invoke). This simplifies the overall design, reduces code duplication, and makes the system more extensible.

Key changes:

  • New gemini-dispatch workflow:

    • Acts as a central router for all incoming requests.
    • Determines which workflow to call based on the event type and comment commands.
  • Refactored Reusable Workflows:

    • gemini-invoke.yml, gemini-scheduled-triage.yml, gemini-triage.yml, and gemini-review.yml are now workflow_call workflows.
    • Simplified context gathering by relying on inputs from the dispatch workflow.
  • Improved Prompts:

    • The prompts for all workflows have been rewritten to be more persona-driven, secure, and structured.
    • They now include detailed instructions, security constraints, and a clear operational workflow for Gemini CLI GitHub Actions.
  • Documentation Updates:

    • Added a README.md for the new gemini-dispatch workflow.
    • Updated all workflow README.md files to reflect the new dispatch system, including dependencies and setup instructions.
    • Added instructions on how to extend the dispatch workflow with custom commands.
    • Updated the main README.md and the examples/workflows/README.md to include the new gemini-dispatch workflow.

@jerop jerop requested review from a team as code owners August 25, 2025 19:15
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Aug 25, 2025

🤖 Hi @jerop, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@jerop jerop linked an issue Aug 25, 2025 that may be closed by this pull request
Copy link
Contributor

@gemini-cli gemini-cli bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This pull request is a significant and well-executed refactoring of the GitHub Actions workflows. The introduction of the gemini-dispatch workflow simplifies the design, reduces duplication, and improves extensibility. The updated documentation and prompts are excellent, providing clear guidance and a robust operational framework.

🔍 General Feedback

  • The move to a centralized dispatch model is a great improvement for maintainability and scalability.
  • The new prompts are well-defined, with a strong focus on security and a clear, structured workflow for the AI assistant.
  • The documentation updates are comprehensive and will be very helpful for users.
  • There are a few minor inconsistencies in the use of google_api_key across the new workflows, which I've highlighted in the inline comments.

@jerop jerop changed the title feat(workflows): refactor to use dispatch and improve docs feat(workflows): refactor examples/workflows to use dispatch and improve docs Aug 25, 2025
@jerop jerop changed the title feat(workflows): refactor examples/workflows to use dispatch and improve docs feat(workflows): refactor examples/workflows to use dispatch pattern Aug 25, 2025
@jerop jerop force-pushed the feat/dispatch-workflows branch from 613cad1 to efc9b98 Compare August 25, 2025 19:23
This commit refactors the GitHub Actions workflows to use a central dispatch model and significantly improves the documentation.

The `gemini-dispatch` workflow is introduced to act as a single entry point, routing commands to the appropriate reusable workflow (`review`, `triage`, or `invoke`). This simplifies the overall design, reduces code duplication, and makes the system more extensible.

Key changes:

- **New `gemini-dispatch` workflow:**
  - Acts as a central router for all incoming requests.
  - Determines which workflow to call based on the event type and comment commands.

- **Refactored Reusable Workflows:**
  - `gemini-invoke.yml`, `gemini-scheduled-triage.yml`, `gemini-triage.yml`, and `gemini-review.yml` are now `workflow_call` workflows.
  - Simplified context gathering by relying on inputs from the dispatch workflow.

- **Improved Prompts:**
  - The prompts for all workflows have been rewritten to be more persona-driven, secure, and structured.
  - They now include detailed instructions, security constraints, and a clear operational workflow for Gemini CLI GitHub Actions.

- **Documentation Updates:**
  - Added a `README.md` for the new `gemini-dispatch` workflow.
  - Updated all workflow `README.md` files to reflect the new dispatch system, including dependencies and setup instructions.
  - Added instructions on how to extend the dispatch workflow with custom commands.
  - Updated the main `README.md` and the `examples/workflows/README.md` to include the new `gemini-dispatch` workflow.
@jerop jerop merged commit 5210286 into main Aug 25, 2025
51 checks passed
@jerop jerop deleted the feat/dispatch-workflows branch August 25, 2025 19:36
@jerop jerop linked an issue Aug 25, 2025 that may be closed by this pull request
google-github-actions-bot added a commit that referenced this pull request Aug 26, 2025
## What's Changed
* fix(output): separate the stdout and stderr logs by @sethvargo in
#186
* fix: correct step numbering in setup_workload_identity.sh by
@jasmeetsb in
#188
* Try and address TOCTOU issues in gemini-cli.yml by @sethvargo in
#187
* chore: bump `actions/checkout` GitHub Actions by @Marukome0743 in
#193
* docs: add gitignore recommendations across all workflows by @jerop in
#198
* chore: bump `actions/create-github-app-token` from 2.0.6 to 2.1.1 by
@Marukome0743 in
#200
* bug(output): do not print output by default by @sethvargo in
#202
* Add GOOGLE_API_KEY variable by @vivekkairi in
#201
* Stream live output if (and only if) debug mode is enabled by
@sethvargo in
#207
* bug(debug): use `vars` (not `env`) when enabling debug mode by
@sethvargo in
#211
* feat: Add GEMINI_MODEL support by @vivekkairi in
#214
* feat(actions): use the dispatcher pattern to separate concerns by
@sethvargo in
#212
* bug(ci): set id-token permissions by @sethvargo in
#223
* chore: add a debugger by @sethvargo in
#226
* Add release notes generation example in awesome list by @jerop in
#225
* feat(invoke): update invoke prompt to better separate execution flow
by @sethvargo in
#227
* chore(ci): refactor scheduled triage workflow by @sethvargo in
#232
* Fix triage workflow by @sethvargo in
#233
* Auto trigger PR reviews when they are from branches in repo by @jerop
in #234
* rename workflow from `gemini-issue-scheduled-triage` to
`gemini-scheduled-triage` by @jerop in
#238
* feat: rename triage workflows by @jerop in
#240
* feat: rename gemini-cli to gemini-invoke by @jerop in
#239
* rename PR review workflow to be consistent with the rest by @jerop in
#241
* feat(workflows): refactor examples/workflows to use dispatch pattern
by @jerop in
#242
* feat: pin example workflows to v0 by @jerop in
#246
* add google_api_key input in gemini-triage workflows by @jerop in
#243
* feat: add best practices guide by @jerop in
#245

## New Contributors
* @vivekkairi made their first contribution in
#201

**Full Changelog**:
v0.1.11...v0.1.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Synchronize examples/workflows with .github/workflows Comments on Issues Cancel Gemini Execution for Example Workflow

2 participants