Skip to content

Sync Fork with Upstream #54

Sync Fork with Upstream

Sync Fork with Upstream #54

Workflow file for this run

name: Sync Fork with Upstream
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Fork
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Sync with Upstream
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/Fanju6/NetProxy-Magisk.git
git fetch upstream
# 强制使用上游的 main 分支
git checkout main
git reset --hard upstream/main
# 强制推送到 Fork
git push origin main --force