Skip to content

Upgrade to GitHub REST API version 2026-03-10#688

Merged
ulrikandersen merged 4 commits into
developfrom
fix/github-api-version
Apr 28, 2026
Merged

Upgrade to GitHub REST API version 2026-03-10#688
ulrikandersen merged 4 commits into
developfrom
fix/github-api-version

Conversation

@ulrikandersen

@ulrikandersen ulrikandersen commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the following deprecation warning from @octokit/request:

"GET https://api.github.com/repos/shapehq/framna-docs/contents/{path}?ref={ref}" is deprecated. It is scheduled to be removed on Fri, 10 Mar 2028 00:00:00 GMT. See https://docs.github.com/en/rest/about-the-rest-api/api-versions

Passes X-GitHub-Api-Version: 2026-03-10 on each REST call via a shared GITHUB_API_VERSION constant. Constructor-level headers are not propagated by Octokit 5.0.5, so the header must be set per request.

Adds X-GitHub-Api-Version: 2022-11-28 header to all Octokit instances
via a shared makeOctokit() helper.
Copilot AI review requested due to automatic review settings April 28, 2026 06:02
@ulrikandersen ulrikandersen requested a review from simonbs as a code owner April 28, 2026 06:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Pins the GitHub REST API version used by this app’s Octokit client to address a deprecation warning from @octokit/request by ensuring a fixed X-GitHub-Api-Version header is sent.

Changes:

  • Added a shared makeOctokit() helper to centralize Octokit construction.
  • Updated all Octokit call sites in GitHubClient to use the helper so the API version header is applied consistently.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/common/github/GitHubClient.ts Outdated
}

private makeOctokit(auth: string): Octokit {
return new Octokit({ auth, headers: { "X-GitHub-Api-Version": "2022-11-28" } })

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

Octokit’s constructor options typically expect default headers under request: { headers: ... } (not a top-level headers field). If headers is ignored here, the X-GitHub-Api-Version won’t be sent and the deprecation warning will persist. Please move the API version header into the request defaults (and/or verify via a quick request trace that the header is actually present on REST calls).

Suggested change
return new Octokit({ auth, headers: { "X-GitHub-Api-Version": "2022-11-28" } })
return new Octokit({
auth,
request: {
headers: { "X-GitHub-Api-Version": "2022-11-28" }
}
})

Copilot uses AI. Check for mistakes.
simonbs
simonbs previously approved these changes Apr 28, 2026
Move X-GitHub-Api-Version into request.headers where Octokit
actually reads default headers, not the ignored top-level headers field.
Octokit 5.0.5 does not propagate constructor-level headers to requests.
The only reliable way to set the API version is on each REST call directly.
Copilot AI review requested due to automatic review settings April 28, 2026 09:57
@ulrikandersen ulrikandersen changed the title Pin GitHub REST API version to 2022-11-28 Upgrade to GitHub REST API version 2026-03-10 Apr 28, 2026
@ulrikandersen ulrikandersen merged commit d2b1922 into develop Apr 28, 2026
8 checks passed
@ulrikandersen ulrikandersen deleted the fix/github-api-version branch April 28, 2026 10:02
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.

3 participants