-
Notifications
You must be signed in to change notification settings - Fork 318
61 lines (56 loc) · 2.24 KB
/
repository_notifier.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
name: Repository Activity Notifier
on:
push:
branches:
- main
pull_request:
types: [opened, closed, reopened]
issues:
types: [opened, closed, reopened]
jobs:
notify:
runs-on: ubuntu-latest
steps:
# Step 1: Send notification for push events
- name: Notify Push to Main
if: ${{ github.event_name == 'push' }}
uses: appleboy/[email protected]
with:
token: ${{ secrets.TG_TOKEN }}
to: ${{ secrets.TG_CHAT_ID }}
format: markdown
message: |
🚀 *New Push to Main*
- **Repository**: [${{ github.repository }}](https://github.com/${{ github.repository }})
- **Commit SHA**: [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
- **Commit Message**: `${{ github.event.head_commit.message }}`
- **Pusher**: `${{ github.actor }}`
# Step 2: Send notification for pull request events
- name: Notify Pull Request
if: ${{ github.event_name == 'pull_request' }}
uses: appleboy/[email protected]
with:
token: ${{ secrets.TG_TOKEN }}
to: ${{ secrets.TG_CHAT_ID }}
format: markdown
message: |
🔄 *Pull Request Activity*
- **Action**: `${{ github.event.action }}`
- **PR Title**: `${{ github.event.pull_request.title }}`
- **Author**: `${{ github.event.pull_request.user.login }}`
- **Branch**: `${{ github.event.pull_request.head.ref }}`
- **Pull Request URL**: [View PR](${{ github.event.pull_request.html_url }})
# Step 3: Send notification for issue events
- name: Notify Issues
if: ${{ github.event_name == 'issues' }}
uses: appleboy/[email protected]
with:
token: ${{ secrets.TG_TOKEN }}
to: ${{ secrets.TG_CHAT_ID }}
format: markdown
message: |
📝 *Issue Activity*
- **Action**: `${{ github.event.action }}`
- **Issue Title**: `${{ github.event.issue.title }}`
- **Author**: `${{ github.event.issue.user.login }}`
- **Issue URL**: [View Issue](${{ github.event.issue.html_url }})