Generate Auxiliary Lists #332
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 Auxiliary Lists | |
| on: | |
| schedule: | |
| # Runs at 00:00 UTC every day | |
| - cron: '0 0 * * *' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| jobs: | |
| generate: | |
| name: Generate auxiliary token lists | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup dependencies | |
| uses: ./.github/actions/setup-dependencies | |
| with: | |
| authToken: ${{ secrets.PACKAGE_READ_AUTH_TOKEN }} | |
| - name: Generate auxiliary lists | |
| env: | |
| COINGECKO_API_KEY: ${{ secrets.COINGECKO_API_KEY }} | |
| run: yarn generateAuxLists | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git add src/public/ | |
| git status --porcelain | grep "src/public/.*\.json$" || echo "no_changes=true" >> $GITHUB_OUTPUT | |
| - name: Configure Git | |
| if: ${{ !contains(steps.git-check.outputs, 'no_changes') }} | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| - name: Commit and push changes | |
| if: ${{ !contains(steps.git-check.outputs, 'no_changes') }} | |
| env: | |
| BRANCH: ${{ github.ref_name }} | |
| run: | | |
| git commit -m "chore: automated auxiliary lists generation" | |
| git push origin $BRANCH | |
| - name: Create issue on failure | |
| if: failure() | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| with: | |
| script: | | |
| github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: 'Auxiliary Lists Generation Failed', | |
| body: `The workflow to generate auxiliary token lists failed on ${new Date().toISOString()}. | |
| Please check the workflow logs for more details: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` | |
| }) |