diff --git a/.github/workflows/gemini-issue-automated-triage.yml b/.github/workflows/gemini-issue-automated-triage.yml index f6feec3..c7d8075 100644 --- a/.github/workflows/gemini-issue-automated-triage.yml +++ b/.github/workflows/gemini-issue-automated-triage.yml @@ -3,9 +3,25 @@ name: Gemini Automated Issue Triage on: issues: types: [opened, reopened] + issue_comment: + types: [created] + workflow_dispatch: + inputs: + issue_number: + description: 'issue number to triage' + required: true + type: number jobs: triage-issue: + if: > + github.event_name == 'issues' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'issue_comment' && + contains(github.event.comment.body, '@gemini-cli /triage') && + (github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'COLLABORATOR')) timeout-minutes: 5 permissions: issues: write diff --git a/docs/issue-triage.md b/docs/issue-triage.md index d0821e6..0381ccd 100644 --- a/docs/issue-triage.md +++ b/docs/issue-triage.md @@ -10,28 +10,30 @@ graph TD A[Issue Opened or Reopened] B[Scheduled Cron Job] C[Manual Dispatch] + D[Issue Comment with '@gemini-cli /triage' Created] end subgraph "Gemini CLI Action" - D[Get Issue Details] - E{Issue needs triage?} - F[Analyze Issue with Gemini] - G[Apply Labels] + E[Get Issue Details] + F{Issue needs triage?} + G[Analyze Issue with Gemini] + H[Apply Labels] end - A --> D - B --> D - C --> D + A --> E + B --> E + C --> E D --> E - E -- Yes --> F - F --> G - E -- No --> J((End)) - G --> J + E --> F + F -- Yes --> G + G --> H + F -- No --> J((End)) + H --> J ``` The two workflows work together to ensure that all new and existing issues are triaged in a timely manner. -1. **Real-Time Triage**: When a new issue is opened or reopened, a GitHub Actions workflow is triggered. This workflow uses the Gemini CLI to analyze the issue and apply the most appropriate labels. This provides immediate feedback and categorization of new issues. +1. **Real-Time Triage**: When a new issue is opened or reopened, an issue comment that contains `@gemini-cli /triage` is created or when a maintainer of the repo dispatch the triage event, a GitHub Actions workflow is triggered. This workflow uses the Gemini CLI to analyze the issue and apply the most appropriate labels. This provides immediate feedback and categorization of new issues. 2. **Scheduled Triage**: To catch any issues that might have been missed by the real-time triage, a scheduled workflow runs every hour. This workflow specifically looks for issues that have no labels or have the `status/needs-triage` label. This ensures that all issues are eventually triaged. diff --git a/examples/gemini-issue-automated-triage.yml b/examples/gemini-issue-automated-triage.yml index dae99a6..eff5094 100644 --- a/examples/gemini-issue-automated-triage.yml +++ b/examples/gemini-issue-automated-triage.yml @@ -3,9 +3,25 @@ name: Gemini Automated Issue Triage on: issues: types: [opened, reopened] + issue_comment: + types: [created] + workflow_dispatch: + inputs: + issue_number: + description: 'issue number to triage' + required: true + type: number jobs: triage-issue: + if: > + github.event_name == 'issues' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'issue_comment' && + contains(github.event.comment.body, '@gemini-cli /triage') && + (github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'COLLABORATOR')) timeout-minutes: 5 permissions: issues: write