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; }