forked from Zagrios/bs-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.39 KB
/
Copy pathupdate-patreons.yml
File metadata and controls
50 lines (42 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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-file: .nvmrc
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