From ad63b10aead9445dc864203505efb7620957d563 Mon Sep 17 00:00:00 2001 From: Yorun <547747006@qq.com> Date: Sat, 1 Apr 2023 11:52:10 +0000 Subject: [PATCH] ci: update sync action --- .github/workflows/sync.yml | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 9914a603..1c9dc413 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,16 +1,29 @@ -# .github/workflows/sync.yml -name: Sync Fork +name: Upstream Sync on: - schedule: - - cron: "0 8 * * *" # 每天0点触发 + schedule: + - cron: '0 */12 * * *' # every 12 hours + workflow_dispatch: # on button click + jobs: - repo-sync: - runs-on: ubuntu-latest - steps: - - uses: TG908/fork-sync@v1.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} # 这个 token action 会默认配置, 这里只需这样写就行 - owner: Yidadaa # fork 上游项目 owner - head: main # fork 上游项目需要同步的分支 - base: main # 需要同步到本项目的目标分支 + sync_latest_from_upstream: + name: Sync latest commits from upstream repo + runs-on: ubuntu-latest + + steps: + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v3 + + # Step 2: run the sync action + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + upstream_sync_repo: Yidadaa/ChatGPT-Next-Web + upstream_sync_branch: main + target_sync_branch: main + target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set + + # Set test_mode true to run tests instead of the true action!! + test_mode: false