From 697301616dd7ae7412e4a31a78cc4834b062dff2 Mon Sep 17 00:00:00 2001 From: ryrl9703 <18762739367@163.com> Date: Fri, 31 Jan 2025 22:27:30 +0800 Subject: [PATCH] sync fork --- .github/workflows/sync-upstream.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/sync-upstream.yml diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 00000000..bbd32efa --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -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 +