Update mainnet_collection_list.json #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Collection List(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, 'mainnet_collection_list.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 | |
- name: Call Testnet Explorer API | |
id: TestnetRequest | |
if: contains(steps.changed-files.outputs.modified_files, 'testnet_collection_list.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_collection_list.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 }} |