Sync Upstream #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |