Skip to content

Commit 99f27dc

Browse files
authored
Merge pull request #107 from cloudcome/feat/v0.x
fix: 优化 actions 34
2 parents d93b616 + 23b1367 commit 99f27dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/actions/npm-publish/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ runs:
3434
result-encoding: string
3535
script: |
3636
const pkg = require('./package.json');
37-
const safeName = pkg.name.replace(/@(.*)\/(.*)/, '$1__$2');
38-
pkg.name = github.repository_owner + '/' + steps.naming.outputs.replaced;
37+
// originName -> underlineName
38+
// my-pkg -> my-pkg
39+
// @my-scope/my-pkg -> my-scope__my-pkg
40+
const underlineName = pkg.name.replace(/@(.*)\/(.*)/, '$1__$2');
41+
pkg.name = github.repository_owner + '/' + underlineName;
3942
const fs = require('fs');
4043
fs.writeFileSync('package.json', JSON.stringify(pkg));
4144

0 commit comments

Comments
 (0)