Skip to content

Commit

Permalink
sync fork
Browse files Browse the repository at this point in the history
  • Loading branch information
ruoyeruolan committed Jan 31, 2025
1 parent e77237c commit 6973016
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/sync-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

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

0 comments on commit 6973016

Please sign in to comment.