Skip to content

Commit d15b2b5

Browse files
authored
Merge pull request #97 from cloudcome/feat/v0.x
fix: 优化 actions 28
2 parents 8915a35 + 06d0cea commit d15b2b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ runs:
2020
# my-pkg -> my-pkg
2121
# @my-scope/my-pkg -> my-scope__my-pkg
2222
run: |
23-
_n1="${{ steps.pkg.outputs.name }}"
23+
# 原始名称
24+
echo "N1=${{ steps.pkg.outputs.name }}" >> $GITHUB_ENV
2425
# 删除 @ 开头
25-
_n2="${_n1/@/}"
26+
echo "N2=${$N1/@/}" >> $GITHUB_ENV
2627
# 将 / 替换为 __
27-
_n3="${_n2/\//__}"
28-
echo "origin=${{ _n1 }}" >> "$GITHUB_OUTPUT"
29-
echo "underscore=${{ _n3 }}" >> "$GITHUB_OUTPUT"
28+
echo "N3=${N2/\//__}" >> $GITHUB_ENV
29+
echo "origin=$N1" >> "$GITHUB_OUTPUT"
30+
echo "underscore=$N3" >> "$GITHUB_OUTPUT"
3031
3132
- name: 仓库类型是 npm
3233
if: inputs.type == 'npm'
@@ -55,5 +56,5 @@ runs:
5556
with:
5657
data: |
5758
{
58-
"name": "@${{ steps.name.outputs.underscore }}"
59+
"name": "@${{ github.repository_owner }}/${{ steps.name.outputs.underscore }}"
5960
}

0 commit comments

Comments
 (0)