Skip to content

Commit

Permalink
Update notify_explorer.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
h1sk1 authored Mar 28, 2023
1 parent d2ed218 commit 156e220
Showing 1 changed file with 31 additions and 18 deletions.
49 changes: 31 additions & 18 deletions .github/workflows/notify_explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,52 @@ jobs:
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@v35

- name: Call Mainnet Explorer API
id: MainnetRequest
if: ${{ contains(github.event.head_commit.modified, 'mainnet_colleciton_list.json') }}
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'
url: 'https://${{ secrets.MAINNET_URL }}/api/v1/apikey'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": "{{ secrets.MAINNET_APIKEY }}", "function": "updateLists"}'
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(github.event.head_commit.modified, 'testnet_colleciton_list.json') }}
uses: fjogeleit/http-request-action@v1
with:
url: 'https://{{ secrets.TESTNET_URL }}/api/v1'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": "{{ secrets.TESTNET_APIKEY }}", "function": "updateLists"}'
# Testnet Explorer is not deployed yet
# - 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(github.event.head_commit.modified, 'devnet_colleciton_list.json') }}
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'
url: 'https://${{ secrets.DEVNET_URL }}/api/v1/apikey'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": "{{ secrets.DEVNET_APIKEY }}", "function": "updateLists"}'
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.TestnetRequest.outputs.response }}
echo ${{ steps.DevnetRequest.outputs.response }}

0 comments on commit 156e220

Please sign in to comment.