From ce4d91fa9c7202bacb69e7df4f6a1e72b3034b21 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 6 Mar 2024 15:14:03 +0000 Subject: [PATCH] fix: use bearer token (works in broader array of situations) https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28#about-authentication --- src/github.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github.ts b/src/github.ts index 7f492c6..3a3810e 100644 --- a/src/github.ts +++ b/src/github.ts @@ -32,8 +32,7 @@ export async function getGithubReleaseByTag( ): Promise { return await githubFetch( config, - `/repos/${config.repo.repo}/releases/tags/${tag}`, - {} + `/repos/${config.repo.repo}/releases/tags/${tag}` ); } @@ -151,9 +150,10 @@ async function githubFetch( ? "https://api.github.com" : `https://${config.repo.domain}/api/v3`, headers: { + "x-github-api-version": "2022-11-28", ...opts.headers, authorization: config.tokens.github - ? `Token ${config.tokens.github}` + ? `Bearer ${config.tokens.github}` : undefined, }, });