diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index b32320227..971673a56 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -87931,9 +87931,11 @@ function getGitHubHttpHeaders() { const token = core.getInput('token'); const auth = !token ? undefined : `token ${token}`; const headers = { - authorization: auth, accept: 'application/vnd.github.VERSION.raw' }; + if (auth) { + headers.authorization = auth; + } return headers; } exports.getGitHubHttpHeaders = getGitHubHttpHeaders; diff --git a/dist/setup/index.js b/dist/setup/index.js index 6f23cdb61..916f488bb 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -125282,9 +125282,11 @@ function getGitHubHttpHeaders() { const token = core.getInput('token'); const auth = !token ? undefined : `token ${token}`; const headers = { - authorization: auth, accept: 'application/vnd.github.VERSION.raw' }; + if (auth) { + headers.authorization = auth; + } return headers; } exports.getGitHubHttpHeaders = getGitHubHttpHeaders; diff --git a/src/util.ts b/src/util.ts index 8fac69316..94be23477 100644 --- a/src/util.ts +++ b/src/util.ts @@ -166,9 +166,13 @@ export function convertVersionToSemver(version: number[] | string) { export function getGitHubHttpHeaders(): OutgoingHttpHeaders { const token = core.getInput('token'); const auth = !token ? undefined : `token ${token}`; + const headers: OutgoingHttpHeaders = { - authorization: auth, accept: 'application/vnd.github.VERSION.raw' }; + + if (auth) { + headers.authorization = auth; + } return headers; }