From 62edafcebe7e268063596194b3ae71eb1b612781 Mon Sep 17 00:00:00 2001 From: Ke Sun Date: Thu, 16 Apr 2026 17:43:23 +0800 Subject: [PATCH] ci(workflow): add PR number and merge commit SHA to WeChat release notification - Add PR_NUMBER environment variable to capture pull request number - Add MERGE_SHA environment variable to capture merge commit SHA - Extract short SHA (first 7 characters) from merge commit for display - Update notification content to include PR number with # prefix - Update notification content to include short commit SHA - Improve release notification with additional metadata for better traceability --- .github/workflows/release-notify-wechat.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-notify-wechat.yml b/.github/workflows/release-notify-wechat.yml index bc67518b..935d84d5 100644 --- a/.github/workflows/release-notify-wechat.yml +++ b/.github/workflows/release-notify-wechat.yml @@ -121,6 +121,8 @@ jobs: AUTHOR: ${{ github.event.pull_request.user.login }} PR_TITLE: ${{ github.event.pull_request.title }} PR_URL: ${{ github.event.pull_request.html_url }} + PR_NUMBER: ${{ github.event.pull_request.number }} + MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} SOURCERY_FOUND: ${{ steps.sourcery.outputs.found }} SOURCERY_SUMMARY: ${{ steps.sourcery.outputs.summary }} QWEN_SUMMARY: ${{ steps.qwen.outputs.summary }} @@ -135,11 +137,16 @@ jobs: label = "AI变更摘要" summary = os.environ.get("QWEN_SUMMARY", "AI 摘要生成失败") + pr_number = os.environ.get("PR_NUMBER", "") + short_sha = os.environ.get("MERGE_SHA", "")[:7] + content = ( "## 🚀 Release 发布通知\n" - "> 📦 **分支**: " + os.environ["BRANCH"] + "\n" + "> � **分支**: " + os.environ["BRANCH"] + "\n" "> 👤 **提交人**: " + os.environ["AUTHOR"] + "\n" - "> 📝 **标题**: " + os.environ["PR_TITLE"] + "\n\n" + "> 📝 **标题**: " + os.environ["PR_TITLE"] + "\n" + "> 🔢 **PR编号**: #" + pr_number + "\n" + "> 🔖 **Commit**: " + short_sha + "\n\n" "### 🧠 " + label + "\n" + summary + "\n\n" "---\n"