Update Patreon supporters #379
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: | |
| if: github.repository == 'Zagrios/bs-manager' && github.ref == 'refs/heads/master' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: true | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6 | |
| with: | |
| version: 10.34.4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: "pnpm" | |
| cache-dependency-path: | | |
| pnpm-lock.yaml | |
| release/app/pnpm-lock.yaml | |
| - name: Install dependencies | |
| # Native modules need lifecycle scripts, restricted by allowBuilds. | |
| run: pnpm install --frozen-lockfile # NOSONAR | |
| - 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: pnpm exec 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 |