Skip to content

ci: Add opencode to GitHub#605

Merged
ValerianRey merged 4 commits intomainfrom
ci-opencode
Mar 5, 2026
Merged

ci: Add opencode to GitHub#605
ValerianRey merged 4 commits intomainfrom
ci-opencode

Conversation

@PierreQuinton
Copy link
Copy Markdown
Contributor

No description provided.

@PierreQuinton PierreQuinton added the cc: ci Conventional commit type for changes to the CI (Github workflows and actions). label Mar 5, 2026
@PierreQuinton
Copy link
Copy Markdown
Contributor Author

PierreQuinton commented Mar 5, 2026

/oc Can you review this?

EDIT: @ValerianRey I think we can test only after merge. I did not create the workflow, it was automatic (low chance of big mistake, but still we could review). In particular we could have a custom prompt

@ValerianRey
Copy link
Copy Markdown
Contributor

Let's merge to try it out. Ideally I would like to factorize claude.yml and this workflow. We could have something like agent.yml, call it with @ agent:claude or @agent:opencode

A few things to improve (before or after merging, up to you):

  • The triggers could be the same as in claude.yml
  • I'd rather have only a single @OpenCode command, rather than /oc or /opencode. Or maybe a single /opencode command is better (in which case we could update claude to be triggered by /claude instead of @claude.
  • I don't like using @latest version of an external github action, I think it's not very safe. Could we fix the major at least?

@claude
Copy link
Copy Markdown

claude bot commented Mar 5, 2026

Claude finished @ValerianRey's task in 57s —— View job


Review of opencode.yml

  • Read the changed file (opencode.yml) and existing claude.yml
  • Analyze changes and provide review feedback
  • Address @ValerianRey's feedback points

Here's a review of the new workflow, addressing the points raised:

1. Trigger parity with claude.yml

opencode.yml is missing two event triggers that claude.yml has:

# Missing in opencode.yml:
issues:
  types: [opened, assigned]
pull_request_review:
  types: [submitted]

The if condition also doesn't discriminate by event type the way claude.yml does. For example, claude.yml uses:

(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))

For opencode, the review body would need to be checked separately since it's in github.event.review.body rather than github.event.comment.body.

2. Trigger unification

Currently both /oc and /opencode are supported. @ValerianRey suggests picking just one. A single /opencode trigger is consistent and clear. The four-condition if block could be simplified to:

if: |
  startsWith(github.event.comment.body, '/opencode') ||
  contains(github.event.comment.body, ' /opencode')

3. @latest version pinning (.github/workflows/opencode.yml:29)

uses: anomalyco/opencode/github@latest  # ⚠️ unsafe

Using @latest is a security concern — a compromised or breaking release would automatically affect all runs. At minimum, pin to a major version tag (e.g. @v1). For maximum safety, pin to a specific commit SHA.

4. Missing fetch-depth: 1

claude.yml uses fetch-depth: 1 for a shallow clone, which speeds up checkout:

- name: Checkout repository
  uses: actions/checkout@v6
  with:
    fetch-depth: 1

opencode.yml omits this (and has persist-credentials: false instead, which is actually a security improvement — worth keeping both).


Note: I'm unable to directly edit workflow files in .github/workflows/ due to GitHub App permission restrictions. The changes above would need to be applied manually.
| Branch: ci-opencode

@PierreQuinton
Copy link
Copy Markdown
Contributor Author

PierreQuinton commented Mar 5, 2026

For now my goal is only to attempt to replace claude and move away from the lock in we are currently in. Let's keep this simple, we can improve later on. Merge if you are satisfied.

@ValerianRey ValerianRey merged commit b5f33a7 into main Mar 5, 2026
16 checks passed
@ValerianRey ValerianRey deleted the ci-opencode branch March 5, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: ci Conventional commit type for changes to the CI (Github workflows and actions).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants