We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c04087 commit 3d5838dCopy full SHA for 3d5838d
scripts/edgeone/edge-functions/gh/[[default]].js
@@ -127,6 +127,14 @@ export default async function onRequest(context) {
127
if (ifNoneMatch) headers.set("if-none-match", ifNoneMatch);
128
if (ifModifiedSince) headers.set("if-modified-since", ifModifiedSince);
129
headers.set("user-agent", "edgeone-gh-proxy");
130
+ if (kind === "api") {
131
+ const token =
132
+ (context && context.env && context.env.GH_TOKEN) ||
133
+ globalThis.GH_TOKEN;
134
+ if (token) {
135
+ headers.set("authorization", `Bearer ${token}`);
136
+ }
137
138
139
const upstream = await fetch(upstreamUrl, {
140
method,
0 commit comments