OpenCode github action: Add support for pull_request_review and pull_request_review_comment as triggering events #1429

Closed
opened 2026-02-16 17:30:56 -05:00 by yindo · 7 comments
Owner

Originally created by @josh-clanton-powerschool on GitHub (Aug 21, 2025).

Originally assigned to: @fwang on GitHub.

I tried updating my trigger conditions for the opencode github action as documented below. It successfully triggered the github action, but then would give an error like this.

error: Unsupported event type: pull_request_review
      at assertContextEvent (/home/runner/work/_actions/sst/opencode/latest/github/index.ts:268:11)
      at /home/runner/work/_actions/sst/opencode/latest/github/index.ts:127:3

The relevant part of my opencode.yml.

on:
  issue_comment:
    types: [created]                # Regular issue & PR top-level comments
  pull_request_review_comment:
    types: [created]                # Inline (diff) code review comments
  pull_request_review:
    types: [submitted]              # Full review (Approve / Comment / Request changes)

jobs:
  opencode:
    if: |
      (
        github.event_name == 'issue_comment' &&
        (
          contains(github.event.comment.body, ' /oc') ||
          startsWith(github.event.comment.body, '/oc') ||
          contains(github.event.comment.body, ' /opencode') ||
          startsWith(github.event.comment.body, '/opencode')
        )
      ) || (
        github.event_name == 'pull_request_review_comment' &&
        (
          contains(github.event.comment.body, ' /oc') ||
          startsWith(github.event.comment.body, '/oc') ||
          contains(github.event.comment.body, ' /opencode') ||
          startsWith(github.event.comment.body, '/opencode')
        )
      ) || (
        github.event_name == 'pull_request_review' &&
        github.event.review.body != '' &&
        (
          contains(github.event.review.body, ' /oc') ||
          startsWith(github.event.review.body, '/oc') ||
          contains(github.event.review.body, ' /opencode') ||
          startsWith(github.event.review.body, '/opencode')
        )
      )
Originally created by @josh-clanton-powerschool on GitHub (Aug 21, 2025). Originally assigned to: @fwang on GitHub. I tried updating my trigger conditions for the opencode github action as documented below. It successfully triggered the github action, but then would give an error like this. ``` error: Unsupported event type: pull_request_review at assertContextEvent (/home/runner/work/_actions/sst/opencode/latest/github/index.ts:268:11) at /home/runner/work/_actions/sst/opencode/latest/github/index.ts:127:3 ``` The relevant part of my opencode.yml. ``` on: issue_comment: types: [created] # Regular issue & PR top-level comments pull_request_review_comment: types: [created] # Inline (diff) code review comments pull_request_review: types: [submitted] # Full review (Approve / Comment / Request changes) jobs: opencode: if: | ( github.event_name == 'issue_comment' && ( contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc') || contains(github.event.comment.body, ' /opencode') || startsWith(github.event.comment.body, '/opencode') ) ) || ( github.event_name == 'pull_request_review_comment' && ( contains(github.event.comment.body, ' /oc') || startsWith(github.event.comment.body, '/oc') || contains(github.event.comment.body, ' /opencode') || startsWith(github.event.comment.body, '/opencode') ) ) || ( github.event_name == 'pull_request_review' && github.event.review.body != '' && ( contains(github.event.review.body, ' /oc') || startsWith(github.event.review.body, '/oc') || contains(github.event.review.body, ' /opencode') || startsWith(github.event.review.body, '/opencode') ) ) ```
yindo closed this issue 2026-02-16 17:30:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 21, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1375: requested the ability to use github action for non issue event types, specifically mentioning PR reviews

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 21, 2025): This issue might be a duplicate of existing issues. Please check: - #1375: requested the ability to use github action for non issue event types, specifically mentioning PR reviews Feel free to ignore if none of these address your specific case.
Author
Owner

@josh-clanton-powerschool commented on GitHub (Aug 21, 2025):

That issue does look related, but I don't think the underlying problem was ever addressed.

@josh-clanton-powerschool commented on GitHub (Aug 21, 2025): That issue does look related, but I don't think the underlying problem was ever addressed.
Author
Owner

@rekram1-node commented on GitHub (Aug 21, 2025):

from what I have heard the opencode github extension is about to get a very nice update which should close this out

Idk the timeline on it but I can help you w/ action in meantime

@rekram1-node commented on GitHub (Aug 21, 2025): from what I have heard the opencode github extension is about to get a very nice update which should close this out Idk the timeline on it but I can help you w/ action in meantime
Author
Owner

@rekram1-node commented on GitHub (Aug 21, 2025):

this one is currently disabled but at my company internally we have an action similar to this to do PR reviews currently:

https://github.com/sst/opencode/blob/dev/.github/workflows/guidelines-check.yml

@rekram1-node commented on GitHub (Aug 21, 2025): this one is currently disabled but at my company internally we have an action similar to this to do PR reviews currently: https://github.com/sst/opencode/blob/dev/.github/workflows/guidelines-check.yml
Author
Owner

@josh-clanton-powerschool commented on GitHub (Aug 22, 2025):

Thanks for the pointer. The situation I'm trying to cover here is when opencode has already opened a PR, and a dev has code review feedback. I'd want that to trigger another run so that opencode can tweak and push another commit.

@josh-clanton-powerschool commented on GitHub (Aug 22, 2025): Thanks for the pointer. The situation I'm trying to cover here is when opencode has already opened a PR, and a dev has code review feedback. I'd want that to trigger another run so that opencode can tweak and push another commit.
Author
Owner

@fwang commented on GitHub (Aug 22, 2025):

Thanks for the pointer. The situation I'm trying to cover here is when opencode has already opened a PR, and a dev has code review feedback. I'd want that to trigger another run so that opencode can tweak and push another commit.

yeah that makes sense!

As @rekram1-node suggested, I'm adding a code review workflow and doing a big refactoring. Will include this use case.

@fwang commented on GitHub (Aug 22, 2025): > Thanks for the pointer. The situation I'm trying to cover here is when opencode has already opened a PR, and a dev has code review feedback. I'd want that to trigger another run so that opencode can tweak and push another commit. yeah that makes sense! As @rekram1-node suggested, I'm adding a code review workflow and doing a big refactoring. Will include this use case.
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1429