Skip to content

Pin REST API version to 2022-11-28 - #213

Merged
williammartin merged 2 commits into
trunkfrom
wm/pin-api-version
Feb 13, 2026
Merged

williammartin merged 2 commits into
trunkfrom
wm/pin-api-version

Conversation

@williammartin

@williammartin williammartin commented Feb 13, 2026 •

Copy link
Copy Markdown
Member

Description

Currently, go-gh does not set the X-GitHub-Api-Version header, meaning if/when a new version rolls out, consumers of go-gh using APIs that have breaking changes may begin breaking.

This adds X-GitHub-Api-Version: 2022-11-28 as a default header in resolveHeaders(), following the same pattern as the other defaults (Content-Type, User-Agent, etc.). Consumers can override it via ClientOptions.Headers, and SkipDefaultHeaders: true excludes it as expected.

See: https://github.blog/developer-skills/github/to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/

@BagToad BagToad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread pkg/api/http_client.go Resolved
@williammartin
williammartin merged commit 55692c6 into trunk Feb 13, 2026
10 checks passed
@williammartin
williammartin deleted the wm/pin-api-version branch February 13, 2026 18:46
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.

2 participants