-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.73 KB
/
pr.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: PR Notification
on:
pull_request:
types: [opened, reopened, closed] # Listen for both opened and closed events
branches:
- dev
- staging
- main
jobs:
PR_Opened:
if: github.event.action == 'opened' || github.event.action == 'reopened'
name: PR Opened Notification
runs-on: ubuntu-latest
env:
PROJECT: BEE
APP: tokamak-bridge-webapp
ENV: ${{ github.event.pull_request.base.ref }}
steps:
- name: Send Slack notification for opened PR
uses: slackapi/[email protected]
with:
payload: |
{
"env": "${{ env.ENV }}",
"project": "${{env.PROJECT}}",
"app": "${{ env.APP }}",
"pr": "${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}",
"title": "A new PR has been opened."
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
PR_Merged:
if: github.event.action == 'closed' && github.event.pull_request.merged == true
name: PR Merged Notification
runs-on: ubuntu-latest
env:
APP: Tokamak-bridge-WebApp
ENV: ${{ github.event.pull_request.base.ref }}
steps:
- name: Send Slack notification for merged PR
uses: slackapi/[email protected]
with:
payload: |
{
"env": "${{ env.ENV }}",
"app": "${{ env.APP }}",
"pr": "${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}",
"title": "A PR has been merged."
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PR }}