Skip to content

Conversation

@dbpolito
Copy link
Contributor

This is a follow up of: #4828

So this add proper support for pull request events, allowing you do add automatic reviews for example:

name: opencode-review

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  review:
    permissions:
      id-token: write
      contents: read
      pull-requests: read
      issues: read
    steps:
      - uses: actions/checkout@v4
      - uses: sst/opencode/github@latest
        with:
          model: anthropic/claude-opus-4-5
          prompt: |
            Review this pull request:
            - Check for code quality issues
            - Look for potential bugs
            - Suggest improvements

Fixed comment filtering logic to handle both comment events and pull_request events:
- Use triggerCommentId which is undefined for pull_request events
- Guard reaction functions to handle undefined triggerCommentId
- Simplify comment filtering to exclude trigger comment only for comment events
- For comment events: add/remove reactions to/from the comment
- For pull_request events: add/remove reactions to/from the PR body
- This ensures reactions work correctly regardless of the trigger event type
@dbpolito
Copy link
Contributor Author

It seems the action failed due to request timeout, doesn't seem related to this PR... but i can't retry the job...

# Conflicts:
#	packages/opencode/src/cli/cmd/github.ts
@dbpolito
Copy link
Contributor Author

@rekram1-node i've fixed conflicts... lemme your thoughts or you wanna further discuss this on Discord

@rekram1-node
Copy link
Collaborator

/review

@dbpolito
Copy link
Contributor Author

@rekram1-node i already fixed this comment... i pushed at the same time you commented it seems 😬

@rekram1-node
Copy link
Collaborator

/review

@rekram1-node
Copy link
Collaborator

sorry that i spam /review it's just helpful because it catches things I miss

@github-actions
Copy link
Contributor

lgtm

@rekram1-node rekram1-node merged commit 0545c5d into anomalyco:dev Dec 22, 2025
2 checks passed
iljod pushed a commit to iljod/opencode that referenced this pull request Dec 23, 2025
rekram1-node pushed a commit that referenced this pull request Dec 27, 2025
anntnzrb pushed a commit to anntnzrb/opencode-1 that referenced this pull request Dec 29, 2025
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.

2 participants