From 574c6daa528de8774ff0e11d2c64583560b7da93 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Sun, 29 Mar 2020 16:28:34 -0400 Subject: [PATCH] Spike to default the scope from package.json --- src/authutil.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/authutil.ts b/src/authutil.ts index 2ce94939..556cbfef 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -25,6 +25,9 @@ function writeRegistryToFile( if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) { scope = github.context.repo.owner; } + if (!scope && namePrefix = require('./package').name.match('@[^/]+')) { + scope = namePrefix[0]; + } if (scope && scope[0] != '@') { scope = '@' + scope; }