1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2025-04-09 18:35:51 +00:00

Add logging around to find issue

This commit is contained in:
Edward Romero 2020-06-23 20:34:30 -04:00
parent f05d7045cd
commit 527b66817c
2 changed files with 5 additions and 1 deletions

View file

@ -35,6 +35,7 @@ async function getAuthToken(
maxRetries: 3
});
let response: hc.HttpClientResponse = await httpClient.get(authUrl);
console.log(response);
let body: string = await response.readBody();
core.info(body);
let data: any = JSON.parse(body);
@ -48,6 +49,7 @@ async function writeRegistryToFile(
alwaysAuth: string
) {
let scope: string = core.getInput('scope');
console.log(`scope: ${scope}`);
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
scope = github.context.repo.owner;
}
@ -58,7 +60,7 @@ async function writeRegistryToFile(
scope = scope.toLowerCase();
}
core.info(`Setting auth in ${fileLocation}`);
console.log(`Setting auth in ${fileLocation}`);
let newContents: string = '';
if (fs.existsSync(fileLocation)) {
const curContents: string = fs.readFileSync(fileLocation, 'utf8');
@ -74,6 +76,7 @@ async function writeRegistryToFile(
// Check if auth url provided
const authUrl: string = core.getInput('auth-url');
if (authUrl) {
console.log(`authUrl: ${authUrl}`);
// Check if username and password/token provided
const authUser: string = core.getInput('auth-user');
const authPassword: string = core.getInput('auth-password');

View file

@ -26,6 +26,7 @@ export async function run() {
const registryUrl: string = core.getInput('registry-url');
const alwaysAuth: string = core.getInput('always-auth');
if (registryUrl) {
console.log(`registryUrl: ${registryUrl}`);
await auth.configAuthentication(registryUrl, alwaysAuth);
}