Skip to content

Update sync.yml#5

Open
tytestelle wants to merge 1 commit intosamqin123:mainfrom
tytestelle:patch-1
Open

Update sync.yml#5
tytestelle wants to merge 1 commit intosamqin123:mainfrom
tytestelle:patch-1

Conversation

@tytestelle
Copy link
Copy Markdown

name: Sync Fork with Upstream (Keep Workflow)

on:
schedule:
- cron: '0 */4 * * *' # 每 4 小时一次
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 保留完整提交历史

  - name: Set up Git
    run: |
      git config user.name "github-actions[bot]"
      git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

  - name: Backup workflows directory
    run: |
      mkdir -p /tmp/workflows
      cp -r .github/workflows/* /tmp/workflows/ || true

  - name: Add upstream and fetch
    run: |
      git remote add upstream https://github.com/Luckykeeper/MoonTV.git
      git fetch upstream

  - name: Merge upstream changes into main
    run: |
      git checkout main
      git merge upstream/main --no-edit || true

  - name: Restore workflows directory
    run: |
      mkdir -p .github/workflows
      cp -r /tmp/workflows/* .github/workflows/ || true
      git add .github/workflows || true
      git commit -m "Restore workflows after sync" || true

  - name: Push changes to origin
    run: git push origin main

paidabai pushed a commit to paidabai/MoonTV that referenced this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant