-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a workflow to notify vsys explorers when files are changed.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} | ||