mirror of
https://github.com/actions/setup-node
synced 2025-04-09 18:35:51 +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 body = yield response.readBody();
|
||||
console.log(body);
|
||||
let data = JSON.parse(body);
|
||||
console.log(JSON.stringify(data));
|
||||
return '';
|
||||
|
@ -4757,9 +4758,7 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||
// Check if username and password/token provided
|
||||
const authUser = core.getInput('auth-user');
|
||||
const authPassword = core.getInput('auth-password');
|
||||
const authAccessToken = core.getInput('auth-access-token');
|
||||
const authPass = authPassword || authAccessToken;
|
||||
nodeAuthToken = yield getAuthToken(authUrl, authUser, authPass);
|
||||
nodeAuthToken = yield getAuthToken(authUrl, authUser, authPassword);
|
||||
}
|
||||
// Remove http: or https: from front of registry.
|
||||
const authString = `${registryUrl.replace(/(^\w+:|^)/, '')}:_authToken=${nodeAuthToken}`;
|
||||
|
|
|
@ -36,6 +36,7 @@ async function getAuthToken(
|
|||
});
|
||||
let response: hc.HttpClientResponse = await httpClient.get(authUrl);
|
||||
let body: string = await response.readBody();
|
||||
console.log(body);
|
||||
let data: any = JSON.parse(body);
|
||||
console.log(JSON.stringify(data));
|
||||
return '';
|
||||
|
|
Loading…
Add table
Reference in a new issue