HTTP errors when the token is undefined (#556)
* Fixing issues with the handling of the token and avoiding error on when the token is undefined * chore: rebuild action --------- Co-authored-by: Ivan Zosimov <ivanzosimov@github.com>
This commit is contained in:
parent
a2374547df
commit
16ef37f8dd
|
@ -87931,9 +87931,11 @@ function getGitHubHttpHeaders() {
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
const auth = !token ? undefined : `token ${token}`;
|
||||||
const headers = {
|
const headers = {
|
||||||
authorization: auth,
|
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
|
if (auth) {
|
||||||
|
headers.authorization = auth;
|
||||||
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
exports.getGitHubHttpHeaders = getGitHubHttpHeaders;
|
exports.getGitHubHttpHeaders = getGitHubHttpHeaders;
|
||||||
|
|
|
@ -125282,9 +125282,11 @@ function getGitHubHttpHeaders() {
|
||||||
const token = core.getInput('token');
|
const token = core.getInput('token');
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
const auth = !token ? undefined : `token ${token}`;
|
||||||
const headers = {
|
const headers = {
|
||||||
authorization: auth,
|
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
|
if (auth) {
|
||||||
|
headers.authorization = auth;
|
||||||
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
exports.getGitHubHttpHeaders = getGitHubHttpHeaders;
|
exports.getGitHubHttpHeaders = getGitHubHttpHeaders;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue