Skip to content

Commit

Permalink
Fixing issues with the handling of the token and avoiding error on wh…
Browse files Browse the repository at this point in the history
…en the token is undefined
  • Loading branch information
peter-murray authored Nov 17, 2023
1 parent 78078da commit 86039b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 86039b0

Please sign in to comment.