-
Notifications
You must be signed in to change notification settings - Fork 80
143 lines (134 loc) · 4.95 KB
/
telegram.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Telegram Notify
on:
issues:
types: [opened, edited, closed, reopened, milestoned, demilestoned]
issue_comment:
types: [created]
push:
pull_request:
types:
# Exclude 'synchronize' as that is duplicated in the 'push' event
[
assigned,
closed,
converted_to_draft,
edited,
labeled,
locked,
opened,
ready_for_review,
reopened,
review_request_removed,
review_requested,
unassigned,
unlabeled,
unlocked,
]
pull_request_review:
project:
project_card:
types: [created, moved, converted, edited, deleted]
release:
watch:
jobs:
tguser:
runs-on: ubuntu-latest
steps:
- uses: kanga333/variable-mapper@master
with:
key: '${{ github.actor }}'
map: |
{
"djamg": {"tguser": "@dj_amg"},
"jace": {"tguser": "@jackerhack"},
"miteshashar": {"tguser": "@miteshashar"},
"sankarshanmukhopadhyay": {"tguser": "@sankarshan"},
"StephanieBr": {"tguser": "@stephaniebrne"},
"vidya-ram": {"tguser": "@vidya_ramki"},
"zainabbawa": {"tguser": "@Saaweoh"},
"anishTP": {"tguser": "@anishtp"},
".*": {"tguser": "Unknown"}
}
export_to: env
outputs:
tguser: ${{ env.tguser }}
event_notify_all:
if: ${{ !contains(fromJson('["issues", "issue_comment", "pull_request", "pull_request_review", "push"]'), github.event_name) }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in https://github.com/${{ github.repository }}
event_issues:
if: ${{ github.event_name == 'issues' }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}/${{ github.event.action }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}): ${{ github.event.issue.title }} ${{ github.event.issue.html_url }}
event_issue_comment:
if: ${{ github.event_name == 'issue_comment' }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}/${{ github.event.action }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in ${{ github.event.issue.title }} ${{ github.event.issue.html_url }}:
${{ github.event.comment.body }} ${{ github.event.comment.html_url }}
event_pull_request:
if: ${{ github.event_name == 'pull_request' }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}/${{ github.event.action }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}): ${{ github.event.pull_request.title }} ${{ github.event.pull_request.html_url }}
event_pull_request_review:
if: ${{ github.event_name == 'pull_request_review' }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}/${{ github.event.action }} (${{ github.event.review.state }})</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in ${{ github.event.pull_request.title }} ${{ github.event.pull_request.html_url }}:
${{ github.event.review.body }} ${{ github.event.review.html_url }}
event_push:
if: ${{ github.event_name == 'push' }}
needs: tguser
runs-on: ubuntu-latest
steps:
- uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message: |
<b>${{ github.event_name }}</b> by ${{ needs.tguser.outputs.tguser }} (${{ github.actor }}) in ${{ github.repository }}/${{ github.ref_name }}: ${{ github.event.head_commit.message }} ${{ github.event.compare }}