This commit is contained in:
Peter Murray 2023-11-22 15:40:38 -08:00 committed by GitHub
commit 7a4b8ebc4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,9 +166,13 @@ export function convertVersionToSemver(version: number[] | string) {
export function getGitHubHttpHeaders(): OutgoingHttpHeaders { export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
const token = core.getInput('token'); const token = core.getInput('token');
const auth = !token ? undefined : `token ${token}`; const auth = !token ? undefined : `token ${token}`;
const headers: OutgoingHttpHeaders = { const headers: OutgoingHttpHeaders = {
authorization: auth,
accept: 'application/vnd.github.VERSION.raw' accept: 'application/vnd.github.VERSION.raw'
}; };
if (auth) {
headers.authorization = auth;
}
return headers; return headers;
} }