Repository navigation
fix(github): scaffold workflows that don't depend on a private action - #123
Merged
Merged
Conversation
`codev github install` wrote a workflow with `uses: quickbeard/codev-code/github@main`. This repo is private and owned by a user account, not an org, so GitHub cannot share an action in it with any other repository — there is no setting that grants access. Every user who ran the install command got a workflow that failed with "repository not found" the first time they commented /codev. The composite action contained nothing private: it installed the public `codev-code` npm package and ran `codev github run`, passing its inputs through as environment variables. Inline those two steps into the scaffolded workflow and delete `github/action.yml`. Also default USE_GITHUB_TOKEN to true when unset. action.yml declared `default: "true"` while normalizeUseGithubToken() returned false, and the action masked the mismatch by always passing the input explicitly. Without the action an unset variable would send users down the OIDC exchange path, which can never succeed here — the fork has no GitHub App — and fails asking for the id-token: write permission. True is what DIVERGENCES.md already documented as the fork's intent. Update both DIVERGENCES.md rows so an upstream merge doesn't reinstate the action reference or the false default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With action.yml gone the rest of the directory had no consumer. index.ts was a standalone duplicate of the githubRun logic that the composite action never invoked — it ran `codev github run` — and the package was never a member of the root workspaces list, so nothing built, tested, or imported it. The README's content now lives in the hosted docs. Repoint the install command's "Learn more" link from the deleted directory to /en/docs/code/github, which is reachable without access to this private repo. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
The problem
codev github installscaffolded a workflow containing:This repo is private and owned by a user account, not an org, so GitHub cannot share an action in it with any other repository — the private-action sharing setting is org/enterprise only. The runner in a user's repo resolves
uses:with that repo'sGITHUB_TOKEN, which has no access here, so every user who ran the install command got:It only surfaced the first time someone commented
/codev.The fix
github/action.ymlwas acompositeaction containing nothing private — it installed the publiccodev-codenpm package and rancodev github run, passing its inputs through as environment variables. Those two steps are now inlined into the scaffolded workflow, and the action is deleted.The only remaining
uses:isactions/checkout.The second bug
action.ymldeclareduse_github_tokenwithdefault: "true", butnormalizeUseGithubToken()returned false when the variable was unset. The action masked this by always passing the input explicitly, so thefalsebranch was unreachable in practice.Remove the action and an unset variable sends users down the OIDC exchange path against
api.opencode.ai— which can never succeed here, since this fork has no GitHub App — failing with a request for theid-token: writepermission. The default is nowtrue, which is whatDIVERGENCES.md:143already documented as the fork's intent.Changes
packages/opencode/src/cli/cmd/github.handler.ts— inline the install/run steps in the scaffold; defaultUSE_GITHUB_TOKENto truegithub/action.yml— deletedgithub/README.md— retitled "GitHub Integration"; documents the actionless workflowDIVERGENCES.mdrows 143 and 144 — updated, so an upstream merge doesn't reinstate the action reference or the false defaultTest plan
provider=anthropicand parsed it as YAML: 3 steps,envkeysGITHUB_TOKEN, ANTHROPIC_API_KEY, MODEL, provider keys interpolate at the correct indentbun test test/cli/github-action.test.ts test/cli/github-remote.test.ts— 33 pass, 0 failtsc --noEmit -p packages/opencode/tsconfig.json— 11 errors, all pre-existing inpackages/tui/src/component/dialog-move-session.tsx; verified identical count on the base commitbun run lint— 0 errorsFollow-up
Docs in
codev-landing-pageare being updated to match.🤖 Generated with Claude Code