Repository navigation
Add initial opencode github action for reviewing PRs #12201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
83741ac
ebae642
06102a1
4e29c2d
d793b60
27b8edb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: opencode | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| opencode: | ||
| if: | | ||
| contains(github.event.comment.body, '/oc') || | ||
| contains(github.event.comment.body, ' /opencode') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Non-existent actions/checkout@v6 version will cause workflow failure The workflow uses Click to expandImpactThe workflow will fail immediately when triggered because GitHub Actions cannot find version 6 of the checkout action. EvidenceAll other workflows in this repository use # From other workflows in .github/workflows/
uses: actions/checkout@v4But this new workflow uses: uses: actions/checkout@v6The actions/checkout repository only has versions up to v4 as of the current date. Recommendation: Change Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run opencode | ||
| uses: anomalyco/opencode/github@latest | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| model: anthropic/claude-haiku-4-5 | ||
| use_github_token: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Leading space in
/opencodetrigger prevents activation at comment startThe condition
contains(github.event.comment.body, ' /opencode')includes a leading space, so/opencodeat the beginning of a comment will not trigger the workflow.Click to expand
Actual vs Expected Behavior
/opencode(e.g.,/opencode please review) will NOT trigger the workflow/opencodeshould work at any position in the comment, just like/ocInconsistency
Line 12 uses
contains(github.event.comment.body, '/oc')without a leading space, so/ocworks anywhere.Line 13 uses
contains(github.event.comment.body, ' /opencode')with a leading space, creating inconsistent behavior.Impact
Users who type
/opencodeat the start of their comment (the most natural way to invoke a command) will find the workflow doesn't trigger, leading to confusion.Recommendation: Remove the leading space: change
' /opencode'to'/opencode'Was this helpful? React with 👍 or 👎 to provide feedback.