mirror of
https://github.com/actions/setup-node.git
synced 2025-04-24 20:22:13 +00:00
Add types
This commit is contained in:
parent
6b34be1bc2
commit
6e4a7921f0
1 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ export function configAuthentication(registryUrl: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeRegistryToFile(registryUrl: string, fileLocation: 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) {
|
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
||||||
scope = github.context.repo.owner;
|
scope = github.context.repo.owner;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Remove http: or https: from front of registry.
|
// Remove http: or https: from front of registry.
|
||||||
const authString =
|
const authString: string =
|
||||||
registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
||||||
const registryString = scope
|
const registryString: string = scope
|
||||||
? `${scope}:registry=${registryUrl}`
|
? `${scope}:registry=${registryUrl}`
|
||||||
: `registry=${registryUrl}`;
|
: `registry=${registryUrl}`;
|
||||||
newContents += `${authString}${os.EOL}${registryString}`;
|
newContents += `${authString}${os.EOL}${registryString}`;
|
||||||
|
|
Loading…
Add table
Reference in a new issue