Skip to content

opencode with Github action: Failed to fetch version information #1818

Closed

Description

@codeagencybe

When I use the agent with Github, my action doesn't work. I always keep turning into this error:

Run sst/opencode/github@latest
Run curl -fsSL https://opencode.ai/install | bash
  curl -fsSL https://opencode.ai/install | bash
  shell: /opt/homebrew/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    ANTHROPIC_API_KEY: ***
\033[0;31mFailed to fetch version information\033[0m
Error: Process completed with exit code 1.

Image

I followed all the steps like below. My action is triggered, but it fails on the key while the key is set properly

Image Image

What could be the root cause here? I'm using a self hosted runner on my Macbook pro M4.

Thanks.

Activity

  1. AlexZeitler commented on Aug 12, 2025

    @AlexZeitler

    Same for me on Ubuntu Desktop 24.04

  2. AlexZeitler commented on Aug 12, 2025

    @AlexZeitler

    Retrying several times helped

    Image
  3. codeagencybe commented on Aug 12, 2025

    @codeagencybe
    Author

    Retrying several times helped

    Image

    I don't think it started working because you tried multiple times. It's probably because the opencode version is newer that is now downloaded and fixed some bug. You can see that in your screenshot it's downloading 0.4.26

    Dax has pushed a lot of fixes the past 24 hours: https://github.com/sst/opencode/releases
    My test yesterday was downloading like version v0.4.12 or something and there's been at least another 10 new releases since.

  4. codeagencybe commented on Aug 12, 2025

    @codeagencybe
    Author

    I'm still having the same problem though

    Extract from my github runner log:

    Run curl -fsSL https://opencode.ai/install | bash
      curl -fsSL https://opencode.ai/install | bash
      shell: /opt/homebrew/bin/bash --noprofile --norc -e -o pipefail {0}
      env:
        ANTHROPIC_API_KEY: ***
    ##[debug]/opt/homebrew/bin/bash --noprofile --norc -e -o pipefail /Users/codeagency/development/projecten/actions-runner/_work/_temp/ef4249fd-0f16-4110-8729-df148266eda8.sh
    \033[0;31mFailed to fetch version information\033[0m
    Error: Process completed with exit code 1.
    
    

    I'm not sure to what it is referring with the failed to fetch ersion information

    @thdxr any idea what this could be?

    This is my workflow yaml below, and my API key is 300% correct, it's the same one I'm using in Cursor and Opencode sessions.

    name: opencode
    
    on:
      issue_comment:
        types: [created]
    
    jobs:
      opencode:
        if: |
          contains(github.event.comment.body, ' /oc') ||
          startsWith(github.event.comment.body, '/oc') ||
          contains(github.event.comment.body, ' /opencode') ||
          startsWith(github.event.comment.body, '/opencode')
        runs-on: self-hosted
        permissions:
          contents: read
          id-token: write
        steps:
          - name: Checkout repository
            uses: actions/checkout@v4
    
          - name: Run opencode
            uses: sst/opencode/github@latest
            env:
              ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
            with:
              model: anthropic/claude-opus-4-1-20250805
    
    
  5. AlexZeitler commented on Aug 12, 2025

    @AlexZeitler

    Retrying several times helped
    Image

    I don't think it started working because you tried multiple times. It's probably because the opencode version is newer that is now downloaded and fixed some bug. You can see that in your screenshot it's downloading 0.4.26

    Dax has pushed a lot of fixes the past 24 hours: https://github.com/sst/opencode/releases My test yesterday was downloading like version v0.4.12 or something and there's been at least another 10 new releases since.

    Maybe I should play the lottery today or invest somewhere 😝

    Between the failing attempts and the succeeding ones have been just a few minutes - I didn't even close the terminal window.

  6. ejc3 commented on Aug 18, 2025

    @ejc3

    You're probably hitting a github rate limit. If you replace the curl -s with curl -sv in the bash script to check for the latest opencode revision, you will likely see 403 response because you're hitting github's relate limit.

  7. ejc3 commented on Aug 18, 2025

    @ejc3

    Something like this is a work around (if you are installing via container):

    ENV OPENCODE_FALLBACK_VERSION=0.5.7
    RUN curl -fsSL https://opencode.ai/install > /tmp/install.sh && bash /tmp/install.sh || \
        echo "Could not fetch latest revision of opencode, so falling back to $OPENCODE_FALLBACK_VERSION" && \
        (VERSION=$OPENCODE_FALLBACK_VERSION bash -x /tmp/install.sh && rm /tmp/install.sh)
    
    
  8. rekram1-node commented on Oct 16, 2025

    @rekram1-node
    Collaborator

    I found a case in the install script that could cause the install to fail sometimes (github was returning different response structures and it would break the install script in some cases)

    We fixed this a little while ago and so maybe you should see less problems?

    Going to close unless this is still really common for some people

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions