Skip to content

Commit ade76ab

Browse files
ryderstormclaude
andcommitted
feat(ci): enhance opencode workflow with comprehensive triggers
Expand opencode workflow to support multiple trigger events, add timeout/concurrency controls, and simplify command syntax. This brings the workflow to parity with the claude.yml pattern. Changes: - Add pull_request_review_comment, issues, and pull_request_review triggers - Add 30-minute timeout to accommodate extended Codex runs - Add concurrency grouping to prevent duplicate runs - Expand authorization checks to handle all event types with null checks - Simplify command from /oc-gpt-5-codex to /oc-codex - Add version pinning documentation comment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 9768154 commit ade76ab

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

.github/workflows/opencode-gpt-5-codex.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,41 @@ name: opencode-gpt-5-codex
33
on:
44
issue_comment:
55
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, edited]
10+
pull_request_review:
11+
types: [submitted]
612

713
jobs:
814
opencode:
15+
timeout-minutes: 30 # to accomodate Codex's ability to run for extended periods
16+
concurrency:
17+
group: opencode-${{ github.event_name }}-${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}
18+
cancel-in-progress: true
919
if: |
10-
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) &&
11-
(contains(github.event.comment.body, ' /oc-gpt-5-codex') ||
12-
startsWith(github.event.comment.body, '/oc-gpt-5-codex') ||
13-
contains(github.event.comment.body, ' /opencode-gpt-5-codex') ||
14-
startsWith(github.event.comment.body, '/opencode-gpt-5-codex'))
20+
(
21+
github.event_name == 'issue_comment' &&
22+
contains(github.event.comment.body, '/oc-codex') &&
23+
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
24+
) || (
25+
github.event_name == 'pull_request_review_comment' &&
26+
contains(github.event.comment.body, '/oc-codex') &&
27+
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
28+
) || (
29+
github.event_name == 'pull_request_review' &&
30+
github.event.review.body != null &&
31+
contains(github.event.review.body, '/oc-codex') &&
32+
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)
33+
) || (
34+
github.event_name == 'issues' &&
35+
(
36+
(github.event.issue.body != null && contains(github.event.issue.body, '/oc-codex')) ||
37+
contains(github.event.issue.title, '/oc-codex')
38+
) &&
39+
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association)
40+
)
1541
runs-on: ubuntu-latest
1642
permissions:
1743
contents: read
@@ -21,6 +47,7 @@ jobs:
2147
uses: actions/checkout@v4
2248

2349
- name: Run opencode
50+
# They are moving fast at https://github.com/sst/opencode/releases, so pinning the version isn't practical yet. We'll keep it at `latest` for now and monitor the changes for a stable version. Latest version as of this writing is `v0.15.3`.
2451
uses: sst/opencode/github@latest
2552
env:
2653
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY_FOR_OPENCODE }}

0 commit comments

Comments
 (0)