From 7a2ccc1bd16c3c771bdfb2e876783742efce8f86 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 17 May 2026 00:34:03 +0200 Subject: [PATCH] fix(github): silence contents endpoint deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use RFC 6570 reserved expansion ({+path}) so slashes stay literal in the request URL, and pin the contents call to API version 2026-03-10 to clear the Sunset: 2028-03-10 header on the deprecated 2022-11-28 version. The only breaking change in 2026-03-10 (submodule type in directory listings) doesn't affect us — fetchLatestSha is per-file and the array branch already short-circuits. --- src/hooks/useGitHubContent.hook.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/useGitHubContent.hook.ts b/src/hooks/useGitHubContent.hook.ts index 28e1950..927a3fc 100644 --- a/src/hooks/useGitHubContent.hook.ts +++ b/src/hooks/useGitHubContent.hook.ts @@ -15,12 +15,12 @@ export const useGitHubContent = ({ try { const octokit = await getOctokit() const response = await octokit.request( - "GET /repos/{owner}/{repo}/contents/{path}", + "GET /repos/{owner}/{repo}/contents/{+path}", { owner: user, repo, path, - headers: { "X-GitHub-Api-Version": "2022-11-28" } + headers: { "X-GitHub-Api-Version": "2026-03-10" } } ) const data = response?.data @@ -44,7 +44,7 @@ export const useGitHubContent = ({ const octokit = await getOctokit() const response = await octokit.request( - `PUT /repos/{owner}/{repo}/contents/{path}`, + "PUT /repos/{owner}/{repo}/contents/{+path}", { owner: user, repo,