From 20b9f6c73c0dc03a32a5421f127c81456c4b75bb Mon Sep 17 00:00:00 2001 From: lldq666 <179107315+lldq666@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:00:08 +0800 Subject: [PATCH 1/3] Create sync.yml --- .github/workflows/sync.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..33b98bb6e --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,36 @@ +name: Upstream Sync + +permissions: + contents: write + +on: + schedule: + - cron: "0 0 * * *" # 每天 0 点执行一次 + workflow_dispatch: # 支持手动触发 + +jobs: + sync_with_upstream: + name: Sync with Upstream + runs-on: ubuntu-latest + if: ${{ github.event.repository.fork }} + + steps: + - name: Checkout target repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Sync Upstream + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_repo: mtvpls/MoonTVPlus # 替换为上游仓库路径 + upstream_sync_branch: main + target_sync_branch: main + test_mode: false + + - name: Check for Failure + if: failure() + run: | + echo "[Error] 同步失败,可能是上游 workflow 文件变更导致 GitHub 暂停了定时任务,需要手动同步。" + exit 1 From d32905deb684c98ebfa297836404349a2548bf51 Mon Sep 17 00:00:00 2001 From: lldq666 <179107315+lldq666@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:07:11 +0800 Subject: [PATCH 2/3] Update sync.yml --- .github/workflows/sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 33b98bb6e..2b4a0c410 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -16,12 +16,12 @@ jobs: steps: - name: Checkout target repo - uses: actions/checkout@v3 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Sync Upstream - uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 with: target_repo_token: ${{ secrets.GITHUB_TOKEN }} upstream_sync_repo: mtvpls/MoonTVPlus # 替换为上游仓库路径 From a74589e2bec99372ebfcf5b5a0abd22e5a31550d Mon Sep 17 00:00:00 2001 From: lldq666 <179107315+lldq666@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:42:01 +0800 Subject: [PATCH 3/3] Update sync.yml --- .github/workflows/sync.yml | 68 +++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 2b4a0c410..d4b3ffadd 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,36 +1,44 @@ -name: Upstream Sync +name: Fork Sync permissions: - contents: write + contents: write on: - schedule: - - cron: "0 0 * * *" # 每天 0 点执行一次 - workflow_dispatch: # 支持手动触发 + schedule: + - cron: "0 0 * * *" # 每天午夜执行 + workflow_dispatch: # 允许手动触发 jobs: - sync_with_upstream: - name: Sync with Upstream - runs-on: ubuntu-latest - if: ${{ github.event.repository.fork }} - - steps: - - name: Checkout target repo - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Sync Upstream - uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 - with: - target_repo_token: ${{ secrets.GITHUB_TOKEN }} - upstream_sync_repo: mtvpls/MoonTVPlus # 替换为上游仓库路径 - upstream_sync_branch: main - target_sync_branch: main - test_mode: false - - - name: Check for Failure - if: failure() - run: | - echo "[Error] 同步失败,可能是上游 workflow 文件变更导致 GitHub 暂停了定时任务,需要手动同步。" - exit 1 + sync_with_upstream: + name: Sync with Upstream + runs-on: ubuntu-latest + if: ${{ github.event.repository.fork }} + + steps: + - name: Checkout target repo + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Sync Upstream + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_repo: mtvpls/MoonTVPlus + upstream_sync_branch: main + target_sync_branch: main + test_mode: false + + - name: Check for new commits + if: success() + run: echo "Sync completed successfully" + + - name: Check for Failure + if: failure() + run: | + echo "[Error] Sync failed. This might be due to:" + echo "1. Changes in the upstream workflow file" + echo "2. Merge conflicts that need manual resolution" + echo "3. Network issues" + echo "Please check the logs and consider manual sync if needed." + exit 1