mirror of
https://github.com/actions/setup-node
synced 2025-04-09 02:15:52 +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) {
|
||||
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}`;
|
||||
|
|
Loading…
Add table
Reference in a new issue