Skip to content

Sync Upstream

Sync Upstream #2

Workflow file for this run

name: Sync Upstream
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Fork Repository
uses: actions/checkout@v3
with:
persist-credentials: false # 防止使用默认 GitHub token
- name: Configure Upstream
run: |
git remote add upstream https://github.com/original-owner/original-repo.git
git fetch upstream
git checkout main
git merge upstream/main --no-edit
- name: Push Changes to Fork
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin main