sync.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Upstream Sync
  2. permissions:
  3. contents: write
  4. on:
  5. schedule:
  6. - cron: "0 0 * * *" # every day
  7. workflow_dispatch:
  8. jobs:
  9. sync_latest_from_upstream:
  10. name: Sync latest commits from upstream repo
  11. runs-on: ubuntu-latest
  12. if: ${{ github.event.repository.fork }}
  13. steps:
  14. # Step 1: run a standard checkout action
  15. - name: Checkout target repo
  16. uses: actions/checkout@v3
  17. # Step 2: run the sync action
  18. - name: Sync upstream changes
  19. id: sync
  20. uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
  21. with:
  22. upstream_sync_repo: ChatGPTNextWeb/ChatGPT-Next-Web
  23. upstream_sync_branch: main
  24. target_sync_branch: main
  25. target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
  26. # Set test_mode true to run tests instead of the true action!!
  27. test_mode: false
  28. - name: Sync check
  29. if: failure()
  30. run: |
  31. echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次,详细教程请查看:https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E6%89%93%E5%BC%80%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0"
  32. echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed tutorial for instructions: https://github.com/Yidadaa/ChatGPT-Next-Web#enable-automatic-updates"
  33. exit 1