Skip to content

Commit c8ef3a5

Browse files
committed
ci: add commit author to Telegram upload message
1 parent d119741 commit c8ef3a5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
build_debug: ${{ steps.set.outputs.debug }}
3030
build_release: ${{ steps.set.outputs.release }}
3131
commit_msg: ${{ steps.msg.outputs.text }}
32+
commit_author: ${{ steps.msg.outputs.author }}
3233
artifact_list: ${{ steps.set.outputs.artifact_list }}
3334

3435
steps:
@@ -52,12 +53,16 @@ jobs:
5253
- id: msg
5354
run: |
5455
case "${{ github.event_name }}" in
55-
push) TEXT="${{ github.event.head_commit.message }}" ;;
56-
pull_request) TEXT="PR: ${{ github.event.pull_request.title }}" ;;
57-
*) TEXT="FolkPatch Build" ;;
56+
push) TEXT="${{ github.event.head_commit.message }}"
57+
AUTHOR="${{ github.event.head_commit.author.name }}" ;;
58+
pull_request) TEXT="PR: ${{ github.event.pull_request.title }}"
59+
AUTHOR="${{ github.event.pull_request.user.login }}" ;;
60+
*) TEXT="FolkPatch Build"
61+
AUTHOR="${{ github.actor }}" ;;
5862
esac
5963
TEXT="${TEXT%%$'\n'*}"
6064
echo "text=$TEXT" >> "$GITHUB_OUTPUT"
65+
echo "author=$AUTHOR" >> "$GITHUB_OUTPUT"
6166
6267
build_debug:
6368
name: Build Debug
@@ -146,9 +151,7 @@ jobs:
146151
exit 1
147152
fi
148153
149-
CAPTION="${{ needs.prepare.outputs.commit_msg }}
150-
Branch: ${{ github.ref_name }}
151-
Commit: ${{ github.sha }}"
154+
CAPTION="${{ needs.prepare.outputs.commit_msg }}\nBranch: ${{ github.ref_name }}\nCommit: ${{ github.sha }}\nAuthor: ${{ needs.prepare.outputs.commit_author }}"
152155
153156
if [ "$FILE_COUNT" -eq 1 ]; then
154157
curl -sf -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument" \

0 commit comments

Comments
 (0)