go-github

A comprehensive Go client library for the GitHub REST API, covering everything from repos and issues to Actions, Apps, and enterprise admin endpoints.

SDK
Go
vv90.0.0
11,307stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
96/100Excellent
Development Activity100
Maintenance96
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture88
Code Quality92
Innovation60
Learning Curve80

go-github is Google’s official Go client library for the GitHub REST API v3. It wraps nearly every documented GitHub endpoint in a typed, service-oriented client, letting Go programs manage repositories, issues, pull requests, Actions workflows, GitHub Apps, organizations, and enterprise administration without hand-rolling HTTP calls or JSON parsing.

The library is built around a single Client whose functionality is grouped into services (Repositories, Issues, PullRequests, Actions, Organizations, and dozens more), each mapping directly to a section of the GitHub REST documentation. Nearly all of the generated request/response types, pagination handling, rate-limit tracking, and boilerplate accessor methods are produced by code generators that run against GitHub’s OpenAPI description, which is why the library can track new GitHub API surface area quickly and consistently.

With over a decade of history and adoption by a huge share of the Go GitHub-tooling ecosystem, it is the de facto standard for talking to GitHub from Go, used everywhere from CI/CD bots and ChatOps tools to GitHub Apps and internal automation.

What You Get

  • A Client with dozens of typed services (Repositories, Issues, PullRequests, Actions, Organizations, Apps, Admin, and more) covering essentially the full GitHub REST API surface
  • Generated accessor methods (Get*()) for every struct field so callers can safely dereference optional pointer fields without nil-checking boilerplate
  • Built-in primary and secondary rate-limit tracking, including automatic backoff handling for GitHub’s secondary rate limits
  • First-class pagination support via ListOptions and response NextPage fields, plus helper iterators for looping through paginated results
  • Pluggable authentication via WithAuthToken, WithTransport, or WithHTTPClient, compatible with oauth2.Transport and GitHub App installation transports like ghinstallation
  • An otel subpackage providing OpenTelemetry instrumentation for outgoing GitHub API calls
  • A large example/ directory covering common patterns: basic auth, GitHub App auth, uploading release assets, listing environments, rate-limit handling, and more

Common Use Cases

  • CI/CD and release automation - creating releases, uploading release assets, and managing deployment statuses from build pipelines
  • GitHub App and bot development - authenticating as an installation and calling the API on behalf of a GitHub App to build ChatOps bots, review bots, or merge-queue tools
  • Repository and organization management at scale - scripting bulk changes to repository settings, branch protection rules, teams, and member permissions across many repos
  • Actions workflow orchestration - triggering, monitoring, and querying GitHub Actions workflow runs, jobs, and artifacts from external tooling
  • Internal developer platforms - building internal tools that surface GitHub issues, pull requests, and code review status inside a company’s own dashboards

Under The Hood

Architecture go-github is organized around one Client struct (github/github.go) that owns an http.Client, base/upload URLs, rate-limit state, and a set of typed “service” structs (RepositoriesService, IssuesService, ActionsService, etc.) that each wrap the shared client to call their slice of the GitHub API. A private common service value is reused across all public services to avoid a heap allocation per service, and every outgoing request funnels through shared NewRequest/Do helpers that centralize JSON encoding, header construction (API version, media types, auth), and response decoding. Domain logic is split into one file per API resource (repos.go, issues.go, actions_workflows.go, apps_hooks.go, and 200+ similarly-scoped files), so changing one API area touches a narrow, predictable slice of the codebase rather than a shared abstraction.

Tech Stack The module (github.com/google/go-github/v90, tracking Go 1.26 per go.mod) has a deliberately minimal dependency footprint: github.com/google/go-querystring for encoding list/filter options into query strings, and github.com/google/go-cmp as a test-only comparison helper. Authentication is left to composition rather than a built-in OAuth implementation — the README documents wiring in golang.org/x/oauth2 or GitHub App installation transports like ghinstallation via the standard http.RoundTripper interface. A separate otel submodule adds OpenTelemetry tracing as an opt-in dependency rather than a core one, and a scrape submodule handles the handful of GitHub features with no public REST endpoint.

Code Quality The repository pairs virtually every implementation file with a same-named _test.go file (roughly 200 test files matching ~206 source files), using Go’s standard testing package plus go-cmp for structural diffs and a local setup(t) helper that spins up an httptest server to assert on HTTP method, headers, and query values per endpoint. CI (.github/workflows/tests.yml, linter.yml) runs the test suite alongside golangci-lint and a “check generated code is up to date” step, and AGENTS.md/CONTRIBUTING.md codify explicit conventions for file organization, JSON tags, and pagination patterns that contributions are expected to follow. Errors are returned as typed *ErrorResponse/*RateLimitError values carrying the underlying HTTP response rather than being swallowed, and a large share of the boilerplate (field accessors, JSON stringifiers) is machine-generated via go:generate directives rather than hand-maintained, reducing the surface for manual mistakes.

API Design The library favors an explicit, discoverable calling convention: client.<Service>.<Method>(ctx, ...) mirrors the shape of the GitHub REST docs almost one-to-one, so users familiar with GitHub’s API can guess method names correctly. Optional/nullable JSON fields are modeled as pointer struct fields with generated Get*() accessors, trading a bit of verbosity for nil-safety without requiring manual nil checks at every call site. Every request-issuing method takes a context.Context as its first argument for cancellation and deadlines, list endpoints share a consistent *ListOptions parameter and paginated-response convention, and construction is centered on a single NewClient(opts ...ClientOptionsFunc) functional-options entry point rather than a sprawling set of constructors, keeping the entry surface small despite the library’s overall size.

Used by 26 apps in this directory

Go
90%
Apache 2.0

CasaOS

Hosting Control Panel · File Storage

37,228

Your simple, elegant personal cloud OS for home data and apps

View details
51
Repo Health
71
Technical
64
Dependency
Built with
Go90%
Updated 1 years ago
Go
75%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,463

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
65
Dependency
Built with
Go75%
TypeScript23%
Updated 2 days ago
Go
75%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,463

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
65
Dependency
Built with
Go75%
TypeScript23%
Updated 2 days ago
Go
75%
MIT

Digger

Devops · Automation · Developer Tools

5,045

Run Terraform and OpenTofu natively inside your existing CI pipeline — no separate runners, no third-party secrets, no extra compute costs.

View details
74
Repo Health
73
Technical
67
Dependency
Built with
Go75%
TypeScript15%
Updated 4 days ago
Go
79%
Apache 2.0

Dolt

Databases · Data Engineering · Developer Tools

24,440

The SQL database you can branch, merge, diff, and clone — Git for your data, MySQL-compatible and ready for multi-agent AI workflows.

View details
91
Repo Health
9
Technical
65
Dependency
Built with
Go79%
Shell19%
Updated 2 days ago
Go
45%
Apache 2.0

e2a

AI Agents · Automation

189

Give your AI agents a real, authenticated email address — with SPF/DKIM-verified inbound, HMAC-signed delivery, WebSocket fan-out, and human-in-the-loop approval built in.

View details
78
Repo Health
80
Technical
71
Dependency
Built with
Go45%
TypeScript27%
Python14%
Updated 4 days ago
Go
91%
Apache 2.0

FerretDB

Databases

11,066

An open-source MongoDB alternative that translates wire protocol queries to SQL and stores documents in PostgreSQL

View details
56
Repo Health
86
Technical
70
Dependency
Built with
Go91%
Updated 3 months ago
Go
73%
Other

Flipt

Devops · Developer Tools

4,898

Git-native feature flag platform that stores, versions, and deploys feature toggles directly in your own Git repositories with no external database required.

View details
90
Repo Health
83
Technical
69
Dependency
Built with
Go73%
TypeScript26%
Updated 3 days ago
Go
91%
Apache 2.0

Gatus

Monitoring · Devops

12,075

Developer-oriented health dashboard with active endpoint probing, multi-protocol checks, and 40+ alerting integrations so you know about failures before your users do.

View details
79
Repo Health
84
Technical
75
Dependency
Built with
Go91%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search