From c0a989e0885c06828a9c7027ff68baab324805ff Mon Sep 17 00:00:00 2001 From: Linus Olofsson <61837116+LinusOlofsson-maker@users.noreply.github.com> Date: Mon, 22 Jun 2026 01:48:43 +0200 Subject: [PATCH] =?UTF-8?q?fix(portfolio-sync):=20PR=20+=20auto-admin-merg?= =?UTF-8?q?e=20(branch=20protection=20kr=C3=A4ver=20signering)=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/portfolio-sync.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/portfolio-sync.yml b/.github/workflows/portfolio-sync.yml index fe80926..853c733 100644 --- a/.github/workflows/portfolio-sync.yml +++ b/.github/workflows/portfolio-sync.yml @@ -33,14 +33,27 @@ jobs: IMMICH_API_KEY: ${{ secrets.IMMICH_API_KEY }} run: node scripts/portfolio-sync.mjs - - name: Commit & push if changed + - name: Commit, PR & auto-merge if changed if: steps.sync.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.SYNC_PAT }} + SYNC_PAT: ${{ secrets.SYNC_PAT }} + REPO: ${{ github.repository }} + ADDED: ${{ steps.sync.outputs.added }} + REMOVED: ${{ steps.sync.outputs.removed }} run: | + set -e + BRANCH="sync/portfolio-$(date +%Y%m%d-%H%M%S)" git config user.name "portfolio-sync[bot]" git config user.email "actions@github.com" + git checkout -b "$BRANCH" git add src/assets/images/portfolio/ - git commit -m "chore(portfolio): sync ${{ steps.sync.outputs.added }} added, ${{ steps.sync.outputs.removed }} removed from Immich" - git push origin HEAD:main + git commit -m "chore(portfolio): sync ${ADDED} added, ${REMOVED} removed from Immich" + git push "https://x-access-token:${SYNC_PAT}@github.com/${REPO}.git" "$BRANCH" + gh pr create --head "$BRANCH" --base main \ + --title "chore(portfolio): Immich sync (${ADDED} added, ${REMOVED} removed)" \ + --body "Automated portfolio sync from Immich portfolio tag." + gh pr merge "$BRANCH" --squash --admin --delete-branch - name: Trigger Coolify deploy if: steps.sync.outputs.changed == 'true'