File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
.github/actions/npm-publish Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,16 @@ runs:
1616 name : 获取 package.json 信息
1717 uses : jaywcjlove/github-action-package@main
1818
19+ # originName -> underscoreName
20+ # my-pkg -> my-pkg
21+ # @my-scope/my-pkg -> my-scope__my-pkg
1922 - id : naming
2023 name : 命名规则变更
21- shell : bash
22- # originName -> underscoreName
23- # my-pkg -> my-pkg
24- # @my-scope/my-pkg -> my-scope__my-pkg
25- env :
26- UNDERSCORE_NAME : ${${n1/@/}/\//__}
27- run : |
28- echo "N1=${{ steps.pkg.outputs.name }}" >> $GITHUB_ENV
29- echo "origin=$N1" >> "$GITHUB_OUTPUT"
30- echo "underscore=${${N1/@/}/\//__}" >> "$GITHUB_OUTPUT"
24+ uses : frabert/replace-string-action@v2
25+ with :
26+ string : ${{ steps.pkg.outputs.name }}
27+ pattern : ' @(.*)\/(.*)'
28+ replace-with : ' $1__$2'
3129
3230 - name : 仓库类型是 npm
3331 if : inputs.type == 'npm'
5048 with :
5149 data : |
5250 {
53- "name": "@${{ github.repository_owner }}/${{ steps.naming.outputs.underscore }}"
51+ "name": "@${{ github.repository_owner }}/${{ steps.naming.outputs.replaced }}"
5452 }
5553
5654 # 发布
You can’t perform that action at this time.
0 commit comments