Skip to content

fix(github): scaffold workflows that don't depend on a private action - #123

Merged
quickbeard merged 2 commits into
mainfrom
fix/github-workflow-without-action
Jul 24, 2026
Merged

quickbeard merged 2 commits into
mainfrom
fix/github-workflow-without-action

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

The problem

codev github install scaffolded a workflow containing:

- 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 — the private-action sharing setting is org/enterprise only. The runner in a user's repo resolves uses: with that repo's GITHUB_TOKEN, which has no access here, so every user who ran the install command got:

Unable to resolve action quickbeard/codev-code/github@main, repository not found

It only surfaced the first time someone commented /codev.

The fix

github/action.yml was a composite action containing nothing private — it installed the public codev-code npm package and ran codev github run, passing its inputs through as environment variables. Those two steps are now inlined into the scaffolded workflow, and the action is deleted.

- name: Install codev
  run: npm install -g codev-code

- name: Run codev
  run: codev github run
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    MODEL: anthropic/claude-sonnet-4-20250514

The only remaining uses: is actions/checkout.

The second bug

action.yml declared use_github_token with default: "true", but normalizeUseGithubToken() returned false when the variable was unset. The action masked this by always passing the input explicitly, so the false branch 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 the id-token: write permission. The default is now true, which is what DIVERGENCES.md:143 already documented as the fork's intent.

Changes

  • packages/opencode/src/cli/cmd/github.handler.ts — inline the install/run steps in the scaffold; default USE_GITHUB_TOKEN to true
  • github/action.yml — deleted
  • github/README.md — retitled "GitHub Integration"; documents the actionless workflow
  • DIVERGENCES.md rows 143 and 144 — updated, so an upstream merge doesn't reinstate the action reference or the false default

Test plan

  • Rendered the scaffold template with provider=anthropic and parsed it as YAML: 3 steps, env keys GITHUB_TOKEN, ANTHROPIC_API_KEY, MODEL, provider keys interpolate at the correct indent
  • bun test test/cli/github-action.test.ts test/cli/github-remote.test.ts — 33 pass, 0 fail
  • tsc --noEmit -p packages/opencode/tsconfig.json — 11 errors, all pre-existing in packages/tui/src/component/dialog-move-session.tsx; verified identical count on the base commit
  • bun run lint — 0 errors

Follow-up

Docs in codev-landing-page are being updated to match.

🤖 Generated with Claude Code

quickbeard and others added 2 commits July 24, 2026 09:19
`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>
@quickbeard
quickbeard merged commit 873826d into main Jul 24, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the fix/github-workflow-without-action branch July 24, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant