mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
add more logging around auth call to verify results
This commit is contained in:
parent
45faa6726d
commit
d0b49e1c14
2 changed files with 3 additions and 3 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -4722,6 +4722,7 @@ function getAuthToken(authUrl, authUser, authPass) {
|
||||||
});
|
});
|
||||||
let response = yield httpClient.get(authUrl);
|
let response = yield httpClient.get(authUrl);
|
||||||
let body = yield response.readBody();
|
let body = yield response.readBody();
|
||||||
|
console.log(body);
|
||||||
let data = JSON.parse(body);
|
let data = JSON.parse(body);
|
||||||
console.log(JSON.stringify(data));
|
console.log(JSON.stringify(data));
|
||||||
return '';
|
return '';
|
||||||
|
@ -4757,9 +4758,7 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
||||||
// Check if username and password/token provided
|
// Check if username and password/token provided
|
||||||
const authUser = core.getInput('auth-user');
|
const authUser = core.getInput('auth-user');
|
||||||
const authPassword = core.getInput('auth-password');
|
const authPassword = core.getInput('auth-password');
|
||||||
const authAccessToken = core.getInput('auth-access-token');
|
nodeAuthToken = yield getAuthToken(authUrl, authUser, authPassword);
|
||||||
const authPass = authPassword || authAccessToken;
|
|
||||||
nodeAuthToken = yield getAuthToken(authUrl, authUser, authPass);
|
|
||||||
}
|
}
|
||||||
// Remove http: or https: from front of registry.
|
// Remove http: or https: from front of registry.
|
||||||
const authString = `${registryUrl.replace(/(^\w+:|^)/, '')}:_authToken=${nodeAuthToken}`;
|
const authString = `${registryUrl.replace(/(^\w+:|^)/, '')}:_authToken=${nodeAuthToken}`;
|
||||||
|
|
|
@ -36,6 +36,7 @@ async function getAuthToken(
|
||||||
});
|
});
|
||||||
let response: hc.HttpClientResponse = await httpClient.get(authUrl);
|
let response: hc.HttpClientResponse = await httpClient.get(authUrl);
|
||||||
let body: string = await response.readBody();
|
let body: string = await response.readBody();
|
||||||
|
console.log(body);
|
||||||
let data: any = JSON.parse(body);
|
let data: any = JSON.parse(body);
|
||||||
console.log(JSON.stringify(data));
|
console.log(JSON.stringify(data));
|
||||||
return '';
|
return '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue