Skip to content

Commit f40f97d

Browse files
authored
Update display_pr.yml
1 parent 92927bb commit f40f97d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/display_pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@v2
1414

15-
- name: Fetch PR details
16-
id: pr-details
15+
- name: Extract PR information
16+
id: extract-info
1717
run: |
1818
PR_NUMBER=${{ github.event.pull_request.number }}
1919
PR_TITLE=${{ github.event.pull_request.title }}
2020
PR_BODY=${{ github.event.pull_request.body }}
2121
PR_USER=${{ github.event.pull_request.user.login }}
2222
23-
# 获取标签名称,标签之间用逗号分隔
24-
PR_LABELS=$(echo "${{ github.event.pull_request.labels[*].name }}" | tr " " ",")
23+
# 将标签名称提取为以逗号分隔的字符串
24+
PR_LABELS=$(echo "${{ toJson(github.event.pull_request.labels) }}" | jq -r 'map(.name) | join(", ")')
2525
2626
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV
2727
echo "PR_TITLE=${PR_TITLE}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)