1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2025-04-09 02:15:52 +00:00

Add types

This commit is contained in:
Danny McCormick 2019-08-06 18:24:15 -04:00 committed by GitHub
parent 6b34be1bc2
commit 6e4a7921f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`;