Skip to content

Sync and Merge

Sync and Merge #910

name: Sync and Merge
on:
schedule:
- cron: '0 * * * *' # 每小时运行一次
workflow_dispatch: # 允许手动触发
jobs:
sync-and-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "shuohao"
- name: Add upstream repository
run: |
git remote add upstream https://github.com/YueChan/Live.git
git fetch upstream
git checkout main
git merge upstream/main -X theirs --allow-unrelated-histories || true
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Auto-merged with upstream/main using theirs strategy"
fi
- name: Merge files
run: |
bash merge_files.sh
- name: Commit and push changes
run: |
git add .
git commit -am "Merge files into All.m3u" || true
git push -f origin main