fix(github): run bundled installer at pinned ref and allow pinning the CLI version - #39147
Open
laurigates wants to merge 1 commit into
Open
fix(github): run bundled installer at pinned ref and allow pinning the CLI version#39147laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
laurigates
added a commit
to laurigates/.github
that referenced
this pull request
Jul 27, 2026
## Summary Follow-up to #42. The `reusable-opencode.yml` note records that a SHA pin covers only the composite wrapper, because `action.yml` `curl`s the latest opencode CLI at run time regardless of the pin. That gap now has a proposed upstream fix — [anomalyco/opencode#39147](anomalyco/opencode#39147), which runs the installer bundled at the pinned ref and adds a `version` input passed through to it. This points at it and records the action to take here if it lands: bump the pinned SHA and set `version` in the reusable workflow. Would have ridden in #42, but that merged first. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #39163
Type of change
What does this PR do?
Pinning the action to a commit SHA didn't pin anything that runs: the installer was fetched from opencode.ai at run time, and the CLI was always the latest release. The version resolved from the releases API only fed the cache key — it was never passed to the installer.
Two changes:
curl -fsSL https://opencode.ai/install | bash→bash "$GITHUB_ACTION_PATH/../install". The whole repo is checked out when a subdirectory action runs, so./installis already there at the pinned ref.versioninput, passed to the installer asVERSION. The installer already reads it.Two details that aren't obvious from the diff:
bash, notsh—./installis#!/usr/bin/env bashand uses[[ ]].resolved(given to the installer) separately fromversion(cache key). They differ when the API lookup fails:versionkeeps the existinglatestplaceholder, but sendingVERSION=latestto the installer would make it look for a release taggedvlatest, soresolvedis left empty and the installer picks latest itself, as before../installis sha256-identical to what opencode.ai serves today, so this changes where the script comes from, not what it does.How did you verify your code works?
Ran both paths on an
ubuntu-latestrunner against this branch.With
version: "1.18.6"(latest was 1.18.7):Without the input — same as before this PR:
I also checked
$GITHUB_ACTION_PATH/../installresolves on a runner before writing this: for a subdirectory actionaction_pathis_actions/<owner>/<repo>/<ref>/github, so../installlands on the repo-root script.To reproduce: point a workflow at this branch with and without
version, and checkopencode --version.Screenshots / recordings
n/a — not a UI change.
Checklist