Platforms

GitBucket

The GitHub provider pointed at a GitBucket /api/v3. What GitBucket does not serve fails with a sentence, not a 404.
IDgitbucket04 / 05your host /api/v3
Platform / github

GitBucket

Spoken by GitHubProvider, pointed at your host with a baseURL. Same resources, same shapes, its own quirks kept inside.

Access

CreatecreateProvider("github", { baseURL })

Importimport { GitHubProvider } from"@agntn/forges/github"

EnvGH_TOKEN, GITHUB_TOKEN

CLInone, pass the token

Header
Authorization: token
Anonymous
depends on the instance
Threads
unsupported, REST v3 only
Code search
unsupported without the endpoint
Templates
repository scope only

Address it

ts
import { createProvider } from "@agntn/forges";

const gitbucket = await createProvider("github", {
  token: "…",
  baseURL: "https://gitbucket.example.com/api/v3",
});

GitBucket implements the GitHub REST v3 API, so there is no separate provider and I am not writing one. The platform string is github, the host is the baseURL with /api/v3 spelled out. The token chain would ask gh for that host, which is almost never what you want, so pass the token.

What works

Repositories, issues, pull requests, comments, commits and users through the same endpoints the GitHub page lists, as far as your GitBucket version serves them.

What does not

  • Review threads. GitBucket is REST v3 only, no GraphQL. threads.* fails with an explicit unsupported endpoint error rather than a bare 404.
  • Code search. No /search/code endpoint, code.search fails explicitly.
  • Releases. GitBucket has no /releases API, so releases.* is a 501 with a sentence.
  • Reactions. No reactions routes either, so listReactions is a 501 too. Nobody there reacts, apparently.
  • Owner templates. A host without the GitHub Enterprise header is repository scope only. The owner's .github repository is not consulted.
  • GitHub Actions. ci.list is a NotFoundError where /actions/runs is missing.

Gotchas

  • Pull request checks. listChecks still returns the commit statuses when /commits/:sha/check-runs answers 404. GitHub and Enterprise keep that 404 as not found.
  • Pagination follows whatever Link header GitBucket emits. When there is none, a list is one page with no nextCursor.
  • The rate limit headers GitHub sends are usually absent, so a 403 is a PermissionError unless the response carries Retry-After or says rate limit in the body.

Where it lives

src/providers/github.ts, the same class. Anything GitBucket needs is a baseURL away.