From e62b79222befbb3cc74158f61945adc511128f5b Mon Sep 17 00:00:00 2001 From: Zagrios <40181755+Zagrios@users.noreply.github.com> Date: Sun, 31 Aug 2025 21:19:29 +0200 Subject: [PATCH] Update Patreon workflow to create pull requests for changes in patreons.json --- .github/workflows/update-patreons.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/update-patreons.yml b/.github/workflows/update-patreons.yml index 831779c7..8257e30d 100644 --- a/.github/workflows/update-patreons.yml +++ b/.github/workflows/update-patreons.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + pull-requests: write jobs: update-patreons: @@ -33,16 +34,17 @@ jobs: PATREON_USER_AGENT: BSManager - Patreon Sync (GitHub Action) run: npx ts-node ./.erb/scripts/update-patreon.js - - name: Commit and push changes if any - run: | - if [[ -n $(git status --porcelain assets/jsons/patreons.json) ]]; then - git config user.name "GitHub Action" - git config user.email "action@github.com" - git add assets/jsons/patreons.json - git commit -m "chore(patreon): update patreons.json [skip ci]" - git push - else - echo "No changes to commit." - fi + - name: Create Pull Request + 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