Skip to content

Sync from Uni-CTR

Sync from Uni-CTR #4

Workflow file for this run

name: Sync from Uni-CTR
on:
schedule:
- cron: '0 2 * * *' # 每天凌晨2点(UTC)
workflow_dispatch: # 允许手动触发
jobs:
sync_repo:
runs-on: ubuntu-latest
steps:
# Step 1: 检出目标仓库
- name: Checkout Destination Repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
# Step 2: 添加源仓库为远程仓库
- name: Add Source Repo as Remote
run: |
git remote add source https://github.com/archersama/Uni-CTR.git
git fetch source
# Step 3: 同步源仓库内容到目标仓库
- name: Sync from Source to Destination
run: |
git reset --hard source/main # 将目标仓库重置为源仓库的 main 分支内容
git push origin main --force