From 23b136754063ca35527f2a017ce15460ae707720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=23=E4=BA=91=E6=B7=A1=E7=84=B6?= Date: Sat, 18 Mar 2023 01:58:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=20actions=2034?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/npm-publish/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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));