在Telegram消息中显示最后一次提交信息

This commit is contained in:
VillagerTom
2024-02-21 16:05:57 +08:00
parent 3bf3fd9a46
commit 95bc4a9f46

View File

@ -20,6 +20,7 @@ jobs:
outputs:
# 定义输出变量 version以便在其他job中引用
new_version: ${{ steps.version.outputs.new_version }}
last_commit: ${{ steps.get-last-commit.outputs.last_commit }}
steps:
- name: Checkout code
@ -41,6 +42,12 @@ jobs:
first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD)
echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT
- name: 获取最后一次提交
id: get-last-commit
run: |
last_commit=$(git log -1 --pretty="%h %B" --first-parent)
echo "last_commit=$last_commit" >> $GITHUB_OUTPUT
- name: 更新版本号
id: version
run: |
@ -210,5 +217,6 @@ jobs:
path: |
./Pilipala-CI/Pili-${{ needs.update_version.outputs.new_version }}.ipa
./Pilipala-CI/Pili-arm64-v8a-${{ needs.update_version.outputs.new_version }}.apk
CONTEXT: "**Pre-release:** ${{ needs.update_version.outputs.new_version }}"
CONTEXT: "**Pre-release: ${{ needs.update_version.outputs.new_version }}**\n${{ needs.update_version.outputs.last_commit }}"
PARSE_MODE: Markdown