Generate Core Pools JSON #144
This file contains hidden or 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: Generate Core Pools JSON | |
| permissions: | |
| contents: read | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 3" | |
| workflow_dispatch: | |
| jobs: | |
| refresh_core_pools: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event_name == 'schedule' && 'main' || github.ref_name }} | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Install Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Update Files | |
| id: update | |
| run: | | |
| pip3 install -r bal_addresses/requirements.txt | |
| python3 gen_core_pools.py | |
| git add -A | |
| - name: pull-request | |
| id: create-pr | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| commit-message: "Scheduled updates to core pools JSON and whitelist cleanup" | |
| title: "Scheduled updates to core pools JSON and whitelist cleanup" | |
| branch: "gha-corepools" | |
| base: "main" | |
| reviewers: "gosuto-inzasheru" | |
| labels: "Core Pools" | |
| - name: Enable auto-merge | |
| if: steps.create-pr.outputs.pull-request-number | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: gh pr merge --auto --merge ${{ steps.create-pr.outputs.pull-request-number }} |