-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (56 loc) · 2.27 KB
/
notify_explorer.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
name: 'Notify VSYS Explorer'
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
notify:
name: 'Change in Tokenlist(s)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
- name: Call Mainnet Explorer API
id: MainnetRequest
if: contains(steps.changed-files.outputs.modified_files, 'tokenlist.json')
uses: fjogeleit/http-request-action@v1
with:
url: 'https://${{ secrets.MAINNET_URL }}/api/v1/apikey'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": "${{ secrets.MAINNET_APIKEY }}", "function": "updateLists"}'
# Wait for 15s for explorer to update it's lists
timeout: 15000
# Testnet Explorer is not deployed yet
# - name: Call Testnet Explorer API
# id: TestnetRequest
# if: contains(steps.changed-files.outputs.modified_files, 'testnet_tokenlist.json')
# uses: fjogeleit/http-request-action@v1
# with:
# url: 'https://${{ secrets.TESTNET_URL }}/api/v1/apikey'
# method: 'PATCH'
# customHeaders: '{"Content-Type": "application/json"}'
# data: '{"apiKey": "${{ secrets.TESTNET_APIKEY }}", "function": "updateLists"}'
# # Wait for 15s for explorer to update it's lists
# timeout: 15000
- name: Call Devnet Explorer API
id: DevnetRequest
if: contains(steps.changed-files.outputs.modified_files, 'devnet_tokenlist.json')
uses: fjogeleit/http-request-action@v1
with:
url: 'https://${{ secrets.DEVNET_URL }}/api/v1/apikey'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": "${{ secrets.DEVNET_APIKEY }}", "function": "updateLists"}'
timeout: 15000
- name: Show responses
run: |
echo ${{ steps.MainnetRequest.outputs.response }}
# echo ${{ steps.TestnetRequest.outputs.response }}
echo ${{ steps.DevnetRequest.outputs.response }}