mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
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: 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
|