@@ -3,105 +3,59 @@ name: Check notification
3
3
on : [push]
4
4
5
5
jobs :
6
- success :
7
- name : Works properly
8
- runs-on : ubuntu-18.04
6
+ notifications :
7
+ name : Rocket.Chat Notifications
8
+ runs-on : ubuntu-latest
9
9
steps :
10
10
- uses : actions/checkout@master
11
11
12
- - name : Rocket.Chat Notification
12
+ - name : with mention
13
13
uses : ./
14
- if : always()
15
14
with :
16
15
type : ${{ job.status }}
17
16
job_name : ' :robot_face: *Success*'
18
17
mention : ' here'
19
- mention_if : ' failure'
20
- channel : ' #develop'
21
18
url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
22
19
23
- success_no_mention :
24
- name : Works properly without mention
25
- runs-on : ubuntu-18.04
26
- steps :
27
- - uses : actions/checkout@master
28
-
29
- - name : Rocket.Chat Notification
20
+ - name : with mention on success
30
21
uses : ./
31
- if : always()
32
22
with :
33
23
type : ${{ job.status }}
34
- job_name : ' :robot_face: *Success no mention*'
35
- channel : ' #develop'
24
+ job_name : ' :robot_face: *Success*'
25
+ mention : ' here'
26
+ mention_if : ' success'
36
27
url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
37
28
38
- failure :
39
- name : Works failed
40
- runs-on : ubuntu-18.04
41
- steps :
42
- - uses : actions/checkout@master
43
-
44
- - name : Forced failure
45
- continue-on-error : true
46
- run : exit 1
47
-
48
- - name : Rocket.Chat Notification
29
+ - name : with mention on always
49
30
uses : ./
50
- if : failure()
51
31
with :
52
32
type : ${{ job.status }}
53
- job_name : ' :robot_face: *Failure *'
33
+ job_name : ' :robot_face: *Success *'
54
34
mention : ' here'
55
- mention_if : ' failure'
56
- channel : ' #develop'
35
+ mention_if : ' success'
57
36
url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
58
37
59
- - name : Check if work properly
60
- if : failure()
61
- run : |
62
- echo 'Rocket.Chat failure notification succeeded'
63
- exit 0
64
-
65
- cancel :
66
- # You have to cancel this job
67
- name : Works canceled
68
- runs-on : ubuntu-18.04
69
- needs : success
70
- timeout-minutes : 1
71
- steps :
72
- - uses : actions/checkout@master
73
-
74
- - name : Wait
75
- run : sleep 70
76
-
77
- - name : Rocket.Chat Notification
38
+ - name : with mention on failure only
78
39
uses : ./
79
- if : cancelled()
80
40
with :
81
41
type : ${{ job.status }}
82
- job_name : ' :robot_face: *Cancel *'
42
+ job_name : ' :robot_face: *Success no mention *'
83
43
mention : ' here'
84
- mention_if : ' always'
85
- channel : ' #develop'
44
+ mention_if : ' failure'
86
45
url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
87
46
88
- - name : Check if work properly
89
- if : cancelled()
90
- run : |
91
- echo 'Rocket.Chat cancelled notification succeeded'
92
- exit 0
93
-
94
- commit :
95
- name : Include commit data
96
- runs-on : ubuntu-18.04
97
- steps :
98
- - uses : actions/checkout@master
47
+ - name : with no mention
48
+ uses : ./
49
+ with :
50
+ type : ${{ job.status }}
51
+ job_name : ' :robot_face: *Success no mention*'
52
+ url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
99
53
100
- - uses : ./
54
+ - name : with commit info
55
+ uses : ./
101
56
with :
102
57
type : ${{ job.status }}
103
58
job_name : ' :robot_face: *Commit*'
104
- channel : ' #develop'
105
- url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
106
59
commit : ' true'
60
+ url : ${{ secrets.ROCKETCHAT_WEBHOOK }}
107
61
token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments