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:
1919 DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
2020 EC2_SSH_PRIVATE_KEY : ${{ secrets.EC2_SSH_PRIVATE_KEY }}
2121 EC2_PUBLIC_IP_ADDRESS : ${{ secrets.EC2_PUBLIC_IP_ADDRESS }}
22+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
2223
2324 steps :
2425 - name : Checkout
2526 if : ${{ github.event.inputs.build_number == '' }}
2627 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 }}
2733 - name : JDK
2834 if : ${{ github.event.inputs.build_number == '' }}
2935 uses : actions/setup-java@v4
7379 docker ps
7480 echo "$BUILD_NUMBER" > build-number.txt
7581 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