opencode icon indicating copy to clipboard operation
opencode copied to clipboard

GitHub Integration is not pushing changes in PRs

Open MarcelBochtler opened this issue 5 months ago • 2 comments

In my private repository a PR was opened by the renovate bot, updating a dependency. This resulted in a test failure, and I described in a comment how I wanted this to be fixed and used /oc fix this.

The opencode.yml workflow was triggered, and according to the logs it fixed the issue, and created a commit:

{"command":"cd /home/runner/work/my-project/my-project && git commit -m \"...\"","description":"Commit the changes"}

Then opencode created the summary and posted this as a comment in the PR.

Unfortunately, the commit was never pushed to the PR branch and seems to be lost.

My configuration:

name: opencode

on:
  issue_comment:
    types: [created]

jobs:
  opencode:
    if: |
      contains(github.event.comment.body, '/oc') ||
      contains(github.event.comment.body, '/opencode')
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Run opencode
        uses: sst/opencode/github@latest
        env:
          OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
        with:
          model: openrouter/qwen/qwen3-coder:free

The used opencode version was 0.3.84

MarcelBochtler avatar Jul 30 '25 10:07 MarcelBochtler

hmm that's weird... does this happen everytime?

fwang avatar Aug 22 '25 15:08 fwang

Think I've hit this too, couldn't find this issue (Thanks bot for telling me): #3893

As far as I can tell it's because the branchIsDirty() check is false because git status --porcelain returns nothing if we've committed the changes, even if they haven't been pushed

Image

AKTheKnight avatar Nov 04 '25 12:11 AKTheKnight