1
0
Fork 0
mirror of https://github.com/actions/setup-node synced 2024-12-23 05:34:56 +00:00

Spike to default the scope from package.json

This commit is contained in:
Jason Karns 2020-03-29 16:28:34 -04:00
parent eff380dfbc
commit 574c6daa52
No known key found for this signature in database
GPG key ID: 4F072FBC1ACA2746

View file

@ -25,6 +25,9 @@ function writeRegistryToFile(
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;
} }
if (!scope && namePrefix = require('./package').name.match('@[^/]+')) {
scope = namePrefix[0];
}
if (scope && scope[0] != '@') { if (scope && scope[0] != '@') {
scope = '@' + scope; scope = '@' + scope;
} }