Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Murray
7a4b8ebc4f
Merge 86039b0e74 into 9eda6b51cc 2023-11-22 15:40:38 -08:00
Peter Murray
86039b0e74
Fixing issues with the handling of the token and avoiding error on when the token is undefined 2023-11-17 12:11:45 +00:00

View File

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