diff --git a/dist/index.js b/dist/index.js index 2257d71..9752acc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13824,9 +13824,10 @@ var baseFetchAssetFile = async (octokit, { id, outputPath, owner, repo, token }) repo }); let headers = { - accept, - authorization: `token ${token}` + accept }; + if (token !== "") + headers = { ...headers, authorization: `token ${token}` }; if (typeof userAgent !== "undefined") headers = { ...headers, "user-agent": userAgent }; const response = await fetch(url, { body, headers, method }); diff --git a/index.ts b/index.ts index 2d547e9..b5f3623 100644 --- a/index.ts +++ b/index.ts @@ -88,8 +88,10 @@ const baseFetchAssetFile = async ( ); let headers: HeadersInit = { accept, - authorization: `token ${token}`, }; + if (token !== '') + headers = { ...headers, authorization: `token ${token}` }; + if (typeof userAgent !== 'undefined') headers = { ...headers, 'user-agent': userAgent };