diff --git a/.github/actions/npm-publish/action.yml b/.github/actions/npm-publish/action.yml index 27a64d7..d121270 100644 --- a/.github/actions/npm-publish/action.yml +++ b/.github/actions/npm-publish/action.yml @@ -34,8 +34,11 @@ runs: result-encoding: string script: | const pkg = require('./package.json'); - const safeName = pkg.name.replace(/@(.*)\/(.*)/, '$1__$2'); - pkg.name = github.repository_owner + '/' + steps.naming.outputs.replaced; + // originName -> underlineName + // my-pkg -> my-pkg + // @my-scope/my-pkg -> my-scope__my-pkg + const underlineName = pkg.name.replace(/@(.*)\/(.*)/, '$1__$2'); + pkg.name = github.repository_owner + '/' + underlineName; const fs = require('fs'); fs.writeFileSync('package.json', JSON.stringify(pkg));