build: do not pass undefined to Auth header in CI scripts
This commit is contained in:
parent
d313ddbd3d
commit
a48968c1ce
1 changed files with 7 additions and 4 deletions
|
@ -36,11 +36,14 @@ const vstsArmJobs = [
|
||||||
let jobRequestedCount = 0;
|
let jobRequestedCount = 0;
|
||||||
|
|
||||||
async function makeRequest ({ auth, url, headers, body, method }) {
|
async function makeRequest ({ auth, url, headers, body, method }) {
|
||||||
const response = await got(url, {
|
const clonedHeaders = {
|
||||||
headers: {
|
|
||||||
Authorization: auth && auth.bearer ? `Bearer ${auth.bearer}` : undefined,
|
|
||||||
...(headers || {})
|
...(headers || {})
|
||||||
},
|
};
|
||||||
|
if (auth && auth.bearer) {
|
||||||
|
clonedHeaders.Authorization = `Bearer ${auth.bearer}`;
|
||||||
|
}
|
||||||
|
const response = await got(url, {
|
||||||
|
headers: clonedHeaders,
|
||||||
body,
|
body,
|
||||||
method,
|
method,
|
||||||
auth: auth && auth.password ? `${auth.username}:${auth.password}` : undefined
|
auth: auth && auth.password ? `${auth.username}:${auth.password}` : undefined
|
||||||
|
|
Loading…
Reference in a new issue