[PR #6157] github: support issues and workflow_dispatch events #11754

Closed
opened 2026-02-16 18:16:41 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6157

State: closed
Merged: Yes


Adds support for issues (opened, edited) and workflow_dispatch events in the GitHub Action. Picks up from the work in #5810.

I've used this as an opportunity to refactor the event handling to make it easier to read + maintain going forward.

  • categorize events into USER_EVENTS and REPO_EVENTS for clearer routing
  • USER_EVENTS (issue_comment, pull_request_review_comment, issues, pull_request): have actor, support reactions/comments
  • REPO_EVENTS (schedule, workflow_dispatch): no actor, output to logs/PR only
  • require prompt input for issues events (no comment to parse)
  • add reaction to issue itself for issues events (same as pull_request)
  • update docs with new events in supported events table
  • add issues triage workflow example with account age filter
  • fix docs formatting for scheduled workflows note

Event Routing

┌─────────────────────────────────────────────────────────────────────────────┐
│                           GithubRunCommand.handler()                        │
│  1. Parse context & normalize inputs                                        │
│  2. Get app token (OIDC or GITHUB_TOKEN)                                    │
│  3. Configure git                                                           │
└─────────────────────────────────────────────────────────────────────────────┘
                                      │
                    ┌─────────────────┴─────────────────┐
               isUserEvent                        isRepoEvent
                    │                                   │
                    ▼                                   ▼
┌───────────────────────────────────┐  ┌───────────────────────────────────┐
│         USER_EVENTS               │  │         REPO_EVENTS               │
│  - issue_comment                  │  │  - schedule                       │
│  - pull_request_review_comment    │  │  - workflow_dispatch              │
│  - issues (opened, edited)        │  │                                   │
│  - pull_request                   │  │                                   │
├───────────────────────────────────┤  ├───────────────────────────────────┤
│  FLOW:                            │  │  FLOW:                            │
│  1. assertPermissions(actor)      │  │  1. (no permission check)         │
│  2. addReaction()                 │  │  2. (no reaction)                 │
│  3. chat() with context           │  │  3. chat()                        │
│  4. createComment(response)       │  │  4. console.log() or createPR()   │
│  5. removeReaction()              │  │                                   │
└───────────────────────────────────┘  └───────────────────────────────────┘

USER vs. REPO event handling

Aspect USER_EVENTS REPO_EVENTS
Actor Present None
Issue/PR context Always has issueId None
Permission check Yes No
Reaction Add before, remove after None
Output Comment on issue/PR Logs only (+ PR if changes)
Prompt source Comment body or PROMPT env PROMPT env (required)
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6157 **State:** closed **Merged:** Yes --- Adds support for `issues` (opened, edited) and `workflow_dispatch` events in the GitHub Action. Picks up from the work in #5810. I've used this as an opportunity to refactor the event handling to make it easier to read + maintain going forward. - categorize events into `USER_EVENTS` and `REPO_EVENTS` for clearer routing - `USER_EVENTS` (issue_comment, pull_request_review_comment, issues, pull_request): have actor, support reactions/comments - `REPO_EVENTS` (schedule, workflow_dispatch): no actor, output to logs/PR only - require `prompt` input for `issues` events (no comment to parse) - add reaction to issue itself for `issues` events (same as `pull_request`) - update docs with new events in supported events table - add issues triage workflow example with account age filter - fix docs formatting for scheduled workflows note #### Event Routing ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ GithubRunCommand.handler() │ │ 1. Parse context & normalize inputs │ │ 2. Get app token (OIDC or GITHUB_TOKEN) │ │ 3. Configure git │ └─────────────────────────────────────────────────────────────────────────────┘ │ ┌─────────────────┴─────────────────┐ isUserEvent isRepoEvent │ │ ▼ ▼ ┌───────────────────────────────────┐ ┌───────────────────────────────────┐ │ USER_EVENTS │ │ REPO_EVENTS │ │ - issue_comment │ │ - schedule │ │ - pull_request_review_comment │ │ - workflow_dispatch │ │ - issues (opened, edited) │ │ │ │ - pull_request │ │ │ ├───────────────────────────────────┤ ├───────────────────────────────────┤ │ FLOW: │ │ FLOW: │ │ 1. assertPermissions(actor) │ │ 1. (no permission check) │ │ 2. addReaction() │ │ 2. (no reaction) │ │ 3. chat() with context │ │ 3. chat() │ │ 4. createComment(response) │ │ 4. console.log() or createPR() │ │ 5. removeReaction() │ │ │ └───────────────────────────────────┘ └───────────────────────────────────┘ ``` #### USER vs. REPO event handling | Aspect | USER_EVENTS | REPO_EVENTS | |--------|-------------|-------------| | Actor | Present | None | | Issue/PR context | Always has issueId | None | | Permission check | Yes | No | | Reaction | Add before, remove after | None | | Output | Comment on issue/PR | Logs only (+ PR if changes) | | Prompt source | Comment body or PROMPT env | PROMPT env (required) |
yindo added the pull-request label 2026-02-16 18:16:41 -05:00
yindo closed this issue 2026-02-16 18:16:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11754