Skip to content

Commit

Permalink
Create notify_explorer.yml
Browse files Browse the repository at this point in the history
Create a workflow to notify vsys explorers when files are changed.
  • Loading branch information
h1sk1 authored Mar 28, 2023
1 parent aff4563 commit 3e8db6a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/notify_explorer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Notify VSYS Explorer'

on:
push:
branches:
- feat/test-notify

# 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:
- name: Call Mainnet Explorer API
id: MainnetRequest
if: ${{ contains(github.event.head_commit.modified, "mainnet_colleciton_list.json") }}
uses: fjogeleit/http-request-action@v1
with:
url: 'https://{{ secrets.MAINNET_URL }}/api/v1'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": {{ secrets.MAINNET_APIKEY }}, "function": "updateLists"}'

- 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"}'

- name: Call Devnet Explorer API
id: DevnetRequest
if: ${{ contains(github.event.head_commit.modified, "devnet_colleciton_list.json") }}
uses: fjogeleit/http-request-action@v1
with:
url: 'https://{{ secrets.DEVNET_URL }}/api/v1'
method: 'PATCH'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"apiKey": {{ secrets.DEVNET_APIKEY }}, "function": "updateLists"}'

- name: Show responses
run: |
echo ${{ steps.MainnetRequest.outputs.response }}
echo ${{ steps.TestnetRequest.outputs.response }}
echo ${{ steps.DevnetRequest.outputs.response }}

0 comments on commit 3e8db6a

Please sign in to comment.