-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 2.18 KB
/
opencode.yml
File metadata and controls
66 lines (55 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: opencode
on:
issue_comment:
types: [created]
# You can set permissions either for everything in this workflow (you would
# add those here) or for individual jobs, as below.
#
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
# Sections: permissions jobsjob_idpermissions
# how-permissions-are-calculated-for-a-workflow-job
#
# ??? None of these sections are clear on whether the local settings are
# merged or override the global setting.
concurrency:
# Currently, since we're only reacting to an issue comment, issue.number
# below will always be valid. However, if we add a different event above,
# using run_id will help us fall back to a unique id.
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
# cancel-in-progress: true
cancel-in-progress: false
jobs:
comment_on_issue:
name: Comment on issue ${{ github.event.issue.number }}
if: >-
contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) &&
github.event.comment.user.type != 'Bot' &&
github.event.issue.pull_request == null &&
( contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
id-token: write
contents: read
issues: write
# pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
# This tests for the variable in the environment, not in secrets.
# - name: Verify required secrets
# run: |
# test -n "${OPENROUTER_API_KEY}" || { echo 'OPENROUTER_API_KEY is not set'; exit 1; }
# env:
# OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
- name: Run OpenCode
uses: sst/opencode/github@latest
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
with:
model: openrouter/anthropic/claude-sonnet-4
# Alternative direct provider if you switch later:
# model: anthropic/claude-sonnet-4-20250514
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}