Skip to content

Fetch monikers.json file #745

Fetch monikers.json file

Fetch monikers.json file #745

---
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 <[email protected]>
commit-message: 'chore: update monikers.json'
branch: monikers/patch
title: Update monikers.json
body: New monikers fetched