Skip to content

Commit cdb0bd9

Browse files
ryderstormclaude
andauthored
feat: add opencode configuration (#11)
* feat: add opencode configuration * feat(ci): restrict opencode workflow to authorized users only Add author association checks to ensure only repository owners, members, and collaborators can trigger the opencode workflow. This prevents unauthorized users from triggering potentially expensive operations. Changes: - Check comment.author_association before evaluating commands - Require OWNER, MEMBER, or COLLABORATOR status - Use consistent pattern with claude.yml workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * 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]> * fix: correct typo --------- Co-authored-by: Claude <[email protected]>
1 parent 84fb711 commit cdb0bd9

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: opencode-gpt-5-codex
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, edited]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
opencode:
15+
timeout-minutes: 30 # to accommodate 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
19+
if: |
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+
)
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
44+
id-token: write
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
48+
49+
- 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`.
51+
uses: sst/opencode/github@latest
52+
env:
53+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY_FOR_OPENCODE }}
54+
with:
55+
model: openai/gpt-5-codex

0 commit comments

Comments
 (0)