diff --git a/src/authutil.ts b/src/authutil.ts index 2ce94939..07ca0851 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -25,6 +25,12 @@ function writeRegistryToFile( if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) { scope = github.context.repo.owner; } + if (!scope) { + let namePrefix = require('./package').name.match('@[^/]+'); + if (namePrefix) { + scope = namePrefix[0]; + } + } if (scope && scope[0] != '@') { scope = '@' + scope; }