mirror of
https://github.com/actions/setup-node
synced 2024-12-22 21:22:42 +00:00
Spike to default the scope from package.json
This commit is contained in:
parent
eff380dfbc
commit
574c6daa52
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue