|
| 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