9
9
steps :
10
10
- name : Checkout source code
11
11
uses : actions/checkout@v3
12
+ with :
13
+ fetch-depth : 0
14
+
15
+ - name : Get commit message and author
16
+ id : get_commit_info
17
+ run : |
18
+ echo "::set-output name=message::$(git log --format=%s -n 1)"
19
+ echo "::set-output name=author::$(git log --format=%an -n 1)"
20
+ echo "::set-output name=author_username::$(git log --format=%ae -n 1 | cut -d@ -f1)"
12
21
13
22
- name : Install dependencies
14
23
run : yarn install
@@ -29,17 +38,30 @@ jobs:
29
38
if : steps.deploy.outcome == 'success'
30
39
env :
31
40
DISCORD_WEBHOOK : ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
41
+ DISCORD_USERNAME : GitHub
42
+ DISCORD_AVATAR : https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
32
43
uses : Ilshidur/action-discord@master
33
44
with :
34
- args : " 🎉 배포가 성공적으로 완료되었습니다! 브랜치: develop"
45
+ args : |
46
+ 🎉 배포가 성공적으로 완료되었습니다!
47
+ 브랜치: develop
48
+ 커밋: ${{ steps.get_commit_info.outputs.message }}
49
+ 작성자: ${{ steps.get_commit_info.outputs.author }}
35
50
36
51
- name : Discord notification - Failure
37
52
if : steps.deploy.outcome == 'failure'
38
53
env :
39
54
DISCORD_WEBHOOK : ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
55
+ DISCORD_USERNAME : GitHub
56
+ DISCORD_AVATAR : https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
40
57
uses : Ilshidur/action-discord@master
41
58
with :
42
- args : " ❌ 배포 중 오류가 발생했습니다. 브랜치: develop"
59
+ args : |
60
+ ❌ 배포 중 오류가 발생했습니다.
61
+ 브랜치: develop
62
+ 커밋: ${{ steps.get_commit_info.outputs.message }}
63
+ 작성자: <@${{ steps.get_commit_info.outputs.author_username }}>
64
+ 실패한 워크플로우: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
43
65
44
66
- name : Check deploy result
45
67
if : steps.deploy.outcome == 'failure'
0 commit comments