Skip to content

Commit faab85c

Browse files
Cryolitiazccrs
authored andcommitted
feat(ci/auto-release): use display name instead of id
Log:
1 parent 0160107 commit faab85c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/auto-release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ jobs:
4444
private-key: ${{ secrets.APP_PRIVATE_KEY }}
4545
owner: ${{ github.repository_owner }}
4646

47+
- name: 获取触发者的昵称
48+
id: actor_name
49+
uses: actions/github-script@v7
50+
with:
51+
script: |
52+
const { data: user } = await github.rest.users.getByUsername({
53+
username: context.actor
54+
});
55+
core.setOutput('name', user.name);
56+
4757
- name: 获取触发者的 GitHub 邮箱
4858
id: get_email
4959
uses: evvanErb/get-github-email-by-username-action@v1.25
@@ -60,7 +70,7 @@ jobs:
6070
6171
# 设置用户名
6272
if [ -z "$input_name" ]; then
63-
author_name="${{ github.actor }}"
73+
author_name="${{ steps.actor_name.outputs.name }}"
6474
echo "未提供用户名,使用 GitHub 用户名: $author_name"
6575
else
6676
author_name="$input_name"

0 commit comments

Comments
 (0)