From 1e61bf9af501aea7c03ab5cc4dd4a340426f1f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A0nh=20Trang?= <14819342+trangcongthanh@users.noreply.github.com> Date: Sat, 27 Dec 2025 14:27:35 +0700 Subject: [PATCH] using github repo as User-Agent --- packages/keystatic/src/reader/github.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/keystatic/src/reader/github.ts b/packages/keystatic/src/reader/github.ts index 38ae187da..ad7a396a2 100644 --- a/packages/keystatic/src/reader/github.ts +++ b/packages/keystatic/src/reader/github.ts @@ -46,7 +46,10 @@ export function createGitHubReader< const res = await fetch( `https://api.github.com/repos/${opts.repo}/git/trees/${ref}?recursive=1`, { - headers: opts.token ? { Authorization: `Bearer ${opts.token}` } : {}, + headers: { + 'User-Agent': opts.repo, + ...(opts.token && { Authorization: `Bearer ${opts.token}` }), + }, cache: 'no-store', } );