Skip to content

Conversation

@elithrar
Copy link
Contributor

@elithrar elithrar commented Dec 25, 2025

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)

- add issues and workflow_dispatch to supported event types
- 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
- 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
@elithrar elithrar force-pushed the issues-event-trigger branch from e9c0420 to adb71a0 Compare December 25, 2025 14:12
- workflow_dispatch now logs actor and includes co-author attribution
- add separate branch prefix 'dispatch' for workflow_dispatch events
- fix docs example to include contents:write and pull-requests:write permissions
@elithrar elithrar force-pushed the issues-event-trigger branch from adb71a0 to 88b37dd Compare December 25, 2025 14:13
@elithrar elithrar marked this pull request as ready for review December 25, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant