Fetch monikers.json file #594
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: Fetch monikers.json file | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
fetch_monikers: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Fetch monikers | |
run: >- | |
curl -sS https://staking-api.polygon.technology/api/v2/validators\?limit\=0\&sortBy\=id | | |
jq '.result | reduce .[] as $item ({}; . + { ($item.id | tostring): ($item.name | | |
gsub("^\\s+|\\s+$|[^\\x00-\\x7F]+";"")) }) | with_entries(select(.value != ""))' | |
> monikers.json | |
- name: Create PR | |
uses: lidofinance/create-pull-request@v4 | |
with: | |
author: GitHub <noreply@github.com> | |
commit-message: 'chore: update monikers.json' | |
branch: monikers/patch | |
title: Update monikers.json | |
body: New monikers fetched |