1
+ name : " Send notification"
2
+
3
+ on :
4
+ pull_request :
5
+ types : [closed]
6
+
7
+ jobs :
8
+ send_notification :
9
+ runs-on : ubuntu-latest
10
+ if : github.event.pull_request.merged == true
11
+
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v2
15
+ with :
16
+ fetch-depth : 0
17
+
18
+ - name : Get changed files
19
+ id : changed-files
20
+ uses : tj-actions/changed-files@v32
21
+
22
+ - name : Check if mainnet was changed
23
+ if : contains(steps.changed-files.outputs.all_changed_files, 'shared-config-mainnet.json')
24
+ run : |
25
+ echo "mainnet_changed=true" >> $GITHUB_ENV
26
+
27
+ - name : Send Slack notification for mainnet
28
+
29
+ if : ${{ env.mainnet_changed }}
30
+ with :
31
+ payload : |
32
+ {
33
+ "environment": "MAINNET",
34
+ "pr_url": "${{ github.event.pull_request.html_url }}"
35
+ }
36
+ env :
37
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
38
+
39
+ - name : Check if testnet was changed
40
+ if : contains(steps.changed-files.outputs.all_changed_files, 'shared-config-test.json')
41
+ run : |
42
+ echo "testnet_changed=true" >> $GITHUB_ENV
43
+
44
+ - name : Send Slack notification for testnet
45
+
46
+ if : ${{ env.testnet_changed }}
47
+ with :
48
+ payload : |
49
+ {
50
+ "environment": "TESTNET",
51
+ "pr_url": "${{ github.event.pull_request.html_url }}"
52
+ }
53
+ env :
54
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments