-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (77 loc) · 2.95 KB
/
main.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
name: Notify Slack on Changes
on:
push:
branches:
- main
paths:
- 'frontend/**'
- 'backend/**'
jobs:
notifySlackFrontend:
if: contains(github.event.commits[*].modified, 'frontend/') || contains(github.event.commits[*].added, 'frontend/') || contains(github.event.commits[*].removed, 'frontend/')
runs-on: ubuntu-latest
steps:
- name: Notify Slack about Frontend Changes
uses: 8398a7/action-slack@v3
with:
status: custom
fields: repo,message,commit,author,action
custom_payload: |
{
"channel": "#프론트엔드",
"username": "GitHub",
"text": "A new commit has been pushed to `frontend/` on the `main` branch: ${{ github.event.head_commit.message }}",
"icon_emoji": ":octocat:",
"attachments": [{
"color": "#f4e242",
"fields": [{
"title": "Commit",
"value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>",
"short": true
},{
"title": "Author",
"value": "${{ github.actor }}",
"short": true
},{
"title": "Message",
"value": "${{ github.event.head_commit.message }}",
"short": false
}]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_FRONTEND_URL }}
notifySlackBackend:
if: contains(github.event.commits[*].modified, 'backend/') || contains(github.event.commits[*].added, 'backend/') || contains(github.event.commits[*].removed, 'backend/')
runs-on: ubuntu-latest
steps:
- name: Notify Slack about Backend Changes
uses: 8398a7/action-slack@v3
with:
status: custom
fields: repo,message,commit,author,action
custom_payload: |
{
"channel": "#백엔드",
"username": "GitHub",
"text": "A new commit has been pushed to `backend/` on the `main` branch: ${{ github.event.head_commit.message }}",
"icon_emoji": ":octocat:",
"attachments": [{
"color": "#42e2f4",
"fields": [{
"title": "Commit",
"value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>",
"short": true
},{
"title": "Author",
"value": "${{ github.actor }}",
"short": true
},{
"title": "Message",
"value": "${{ github.event.head_commit.message }}",
"short": false
}]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}