From b93df47b7a1a7abdfd786562e4c4a1c80c41ccbd Mon Sep 17 00:00:00 2001 From: lzblyc <129644607+lzblyc@users.noreply.github.com> Date: Wed, 22 Oct 2025 08:24:32 +0800 Subject: [PATCH] Add GitHub Actions workflow to sync upstream --- .github/workflows/sync-upstream.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/sync-upstream.yml diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 0000000000..d070e00949 --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -0,0 +1,38 @@ +name: Sync Upstream Code Only + +on: + workflow_dispatch: + schedule: + - cron: "0 3 * * *" + +permissions: + contents: write + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Add upstream + run: | + git remote add upstream https://github.com/LibreSpark/LibreTV.git || echo "Upstream exists" + git fetch upstream + + - name: Set Git identity + run: | + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + + - name: Merge upstream excluding workflows + run: | + git checkout main + git checkout upstream/main -- $(git ls-tree -r upstream/main --name-only | grep -v '^.github/workflows/') + git add . + git diff-index --quiet HEAD || git commit -m "🔄 Sync code from upstream" + + - name: Push changes + run: git push origin main