File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,17 @@ jobs:
19
19
DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
20
20
EC2_SSH_PRIVATE_KEY : ${{ secrets.EC2_SSH_PRIVATE_KEY }}
21
21
EC2_PUBLIC_IP_ADDRESS : ${{ secrets.EC2_PUBLIC_IP_ADDRESS }}
22
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
22
23
23
24
steps :
24
25
- name : Checkout
25
26
if : ${{ github.event.inputs.build_number == '' }}
26
27
uses : actions/checkout@v4
28
+ - name : Send slack message with github commit url
29
+ run : >
30
+ curl -X POST -H 'Content-type: application/json'
31
+ --data '{"text":"${{ github.event.head_commit.message }} - https://${{ github.repository }}/commit/${{ github.sha }}"}'
32
+ ${{ env.SLACK_WEBHOOK_URL }}
27
33
- name : JDK
28
34
if : ${{ github.event.inputs.build_number == '' }}
29
35
uses : actions/setup-java@v4
73
79
docker ps
74
80
echo "$BUILD_NUMBER" > build-number.txt
75
81
EOF
82
+ - name : Send slack message with status
83
+ if : always()
84
+ run : >
85
+ curl -X POST -H 'Content-type: application/json'
86
+ --data '{"text":"Job status ${{ job.status }}"}'
87
+ ${{ env.SLACK_WEBHOOK_URL }}
You can’t perform that action at this time.
0 commit comments