Skip to content

Commit

Permalink
fix: 优化 actions 28
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Mar 17, 2023
1 parent fc6c400 commit 06d0cea
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/actions/npm-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ runs:
# my-pkg -> my-pkg
# @my-scope/my-pkg -> my-scope__my-pkg
run: |
_n1="${{ steps.pkg.outputs.name }}"
# 原始名称
echo "N1=${{ steps.pkg.outputs.name }}" >> $GITHUB_ENV
# 删除 @ 开头
_n2="${_n1/@/}"
echo "N2=${$N1/@/}" >> $GITHUB_ENV
# 将 / 替换为 __
_n3="${_n2/\//__}"
echo "origin=${{ _n1 }}" >> "$GITHUB_OUTPUT"
echo "underscore=${{ _n3 }}" >> "$GITHUB_OUTPUT"
echo "N3=${N2/\//__}" >> $GITHUB_ENV
echo "origin=$N1" >> "$GITHUB_OUTPUT"
echo "underscore=$N3" >> "$GITHUB_OUTPUT"
- name: 仓库类型是 npm
if: inputs.type == 'npm'
Expand Down Expand Up @@ -55,5 +56,5 @@ runs:
with:
data: |
{
"name": "@${{ steps.name.outputs.underscore }}"
"name": "@${{ github.repository_owner }}/${{ steps.name.outputs.underscore }}"
}

0 comments on commit 06d0cea

Please sign in to comment.