diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js
index b323202..971673a 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 6f23cdb..916f488 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 8fac693..94be234 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;
 }