From 6e4a7921f09320d9891f6ccda63804def2ff9da2 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 6 Aug 2019 18:24:15 -0400 Subject: [PATCH] Add types --- src/authutil.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authutil.ts b/src/authutil.ts index 9285bb90..c896339c 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -17,7 +17,7 @@ export function configAuthentication(registryUrl: string) { } function writeRegistryToFile(registryUrl: string, fileLocation: string) { - let scope = core.getInput('scope'); + let scope: string = core.getInput('scope'); if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) { scope = github.context.repo.owner; } @@ -37,9 +37,9 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) { }); } // Remove http: or https: from front of registry. - const authString = + const authString: string = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}'; - const registryString = scope + const registryString: string = scope ? `${scope}:registry=${registryUrl}` : `registry=${registryUrl}`; newContents += `${authString}${os.EOL}${registryString}`;