Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Commit 0efdc3a

Browse files
authored
feat: add caching for opencode binary in GitHub Actions (anomalyco#5384)
1 parent fc9dfd0 commit 0efdc3a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

github/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,29 @@ inputs:
2020
runs:
2121
using: "composite"
2222
steps:
23+
- name: Get opencode version
24+
id: version
25+
shell: bash
26+
run: |
27+
VERSION=$(curl -sf https://api.github.com/repos/sst/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)
28+
echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT
29+
30+
- name: Cache opencode
31+
id: cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.opencode/bin
35+
key: opencode-${{ runner.os }}-${{ runner.arch }}-${{ steps.version.outputs.version }}
36+
2337
- name: Install opencode
38+
if: steps.cache.outputs.cache-hit != 'true'
2439
shell: bash
2540
run: curl -fsSL https://opencode.ai/install | bash
2641

42+
- name: Add opencode to PATH
43+
shell: bash
44+
run: echo "$HOME/.opencode/bin" >> $GITHUB_PATH
45+
2746
- name: Run opencode
2847
shell: bash
2948
id: run_opencode

0 commit comments

Comments
 (0)