-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (38 loc) · 1.46 KB
/
pr-alert.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Notify PR Completion
on:
workflow_run:
workflows: [Deployment]
types: [completed]
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Notify current workflow is succeed
uses: actions/github-script@v6
if: success()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: '${{ github.event.pull_request.number }}',
owner: 'ghkdqhrbals',
repo: 'spring-chatting-server',
body: '✅ Build & Test workflow succeed ✅\n- [Show details](https://github.com/ghkdqhrbals/spring-chatting-server/actions/runs/${{ github.run_id }})'
})
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Notify current workflow is failed
uses: actions/github-script@v6
if: failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: '${{ github.event.pull_request.number }}',
owner: 'ghkdqhrbals',
repo: 'spring-chatting-server',
body: '❌ Build & Test workflow failed ❌\n- [Show details](https://github.com/ghkdqhrbals/spring-chatting-server/actions/runs/${{ github.run_id }})'
})