Update Patreon supporters #112
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: Update Patreon supporters | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # Every day at 00:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-patreons: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Patreon update script | |
| env: | |
| PATREON_ACCESS_TOKEN: ${{ secrets.PATREON_ACCESS_TOKEN }} | |
| PATREON_CAMPAIGN_ID: ${{ secrets.PATREON_CAMPAIGN_ID }} | |
| PATREON_USER_AGENT: BSManager - Patreon Sync (GitHub Action) | |
| run: npx ts-node ./.erb/scripts/update-patreon.js | |
| - name: Create Pull Request (only if changes) | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| commit-message: "[chore] update patreons.json" | |
| title: "[chore] update patreons.json" | |
| body: | | |
| Automated daily update of Patreon supporters. | |
| branch: chore/patreon-update | |
| delete-branch: true | |
| add-paths: | | |
| assets/jsons/patreons.json | |