build: use basic auth to trigger CI if either a username OR password is provided

This commit is contained in:
Samuel Attard 2021-08-13 10:40:20 -07:00
parent 1e983e2a6e
commit d1bd9afbbf
No known key found for this signature in database
GPG key ID: FB94249299E904FE

View file

@ -46,7 +46,7 @@ async function makeRequest ({ auth, url, headers, body, method }) {
headers: clonedHeaders,
body,
method,
auth: auth && auth.password ? `${auth.username}:${auth.password}` : undefined
auth: auth && (auth.username || auth.password) ? `${auth.username}:${auth.password}` : undefined
});
if (response.statusCode < 200 || response.statusCode >= 300) {
console.error('Error: ', `(status ${response.statusCode})`, response.body);