Skip to content

Latest commit

 

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode GitHub Actions

A GitHub Action for OpenCode with pinned actions/cache and OpenCode versions.

This action is a fork of the official action. It updates actions/cache, improves the OpenCode installation logic, pins the OpenCode version, and verifies the SHA256 checksum on every run, whether the cache is hit or missed.

Important

This action uses ${{ github.token }} in the Resolve opencode release metadata step only so gh can fetch OpenCode release metadata. By default, the token is not exposed to OpenCode itself. If you want OpenCode to access the token, for example to create issues, pass it through the step environment as GH_TOKEN: ${{ github.token }}.

Non-major actions/cache and OpenCode updates are merged automatically by Renovate. OpenCode uses a one-day minimum release age, while actions/cache uses the shared three-day policy when its update type supports a cooldown; major updates require manual review. Use this action with a pinned Git SHA, and make sure you have a dependency management tool like Renovate or Dependabot enabled so you do not miss updates.

How to use

Use it the same way as the official action.

First, get the latest Git SHA for this repo:

curl -fsSL "https://api.github.com/repos/xlionjuan/opencode-github-actions/branches/main" | jq -r '.commit.sha'

Then replace anomalyco/opencode/github@latest with xlionjuan/opencode-github-actions@{GIT SHA}, using the value from the previous step:

Warning

You should NEVER use latest ! Check Upgrade best practices.

The # main is necessary to let managers knows which branch it should tracking.

- name: Run opencode
  uses: xlionjuan/opencode-github-actions@{GIT SHA} # main

Related issues

These are the reasons I created this forked action.

[FEATURE]: Add version input to the GitHub action anomalyco/opencode#31387

[FEATURE]: Add SHA256 checksum verification to the install script anomalyco/opencode#31390

Mock with act

For development use only.

act workflow_dispatch \
  -W .github/workflows/test.yml \
  -j opencode \
  --secret-file .env

About

Better GitHub Actions for OpenCode, with pinned version and verifies the SHA256

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages