This workflow acts as a central dispatcher for Gemini CLI, routing requests to the appropriate workflow based on the triggering event and the command provided in the comment.
This workflow is triggered by the following events:
- Pull request review comment (created)
- Pull request review (submitted)
- Pull request (opened)
- Issue (opened, reopened)
- Issue comment (created)
The workflow uses a dispatch job to determine which command to execute based on the following logic:
- If a comment contains
@gemini-cli /review, it calls thegemini-review.ymlworkflow. - If a comment contains
@gemini-cli /triage, it calls thegemini-triage.ymlworkflow. - If a comment contains
@gemini-cli(without a specific command), it calls thegemini-invoke.ymlworkflow. - When a new pull request is opened, it calls the
gemini-review.ymlworkflow. - When a new issue is opened or reopened, it calls the
gemini-triage.ymlworkflow.
- gemini-review.yml: This workflow reviews a pull request.
- gemini-triage.yml: This workflow triages an issue.
- gemini-invoke.yml: This workflow is a general-purpose workflow that can be used to perform various tasks.
You can easily extend the dispatch workflow to include your own custom workflows. Here's how:
- Create your workflow file: Create a new YAML file in the
.github/workflowsdirectory with your custom workflow logic. Make sure your workflow is designed to be called byworkflow_call. - Define a new command: Decide on a new command to trigger your workflow, for example,
@gemini-cli /my-command. - Update the
dispatchjob: Ingemini-dispatch.yml, add a new condition to theifstatement in thedispatchjob to recognize your new command. - Add a new job to call your workflow: Add a new job to
gemini-dispatch.ymlthat calls your custom workflow file.
To use this workflow, simply trigger one of the events listed above. For comment-based triggers, make sure the comment starts with @gemini-cli and the appropriate command.