sync.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Upstream Sync
  2. permissions:
  3. contents: write
  4. on:
  5. schedule:
  6. - cron: "0 * * * *" # every hour
  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: Yidadaa/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::由于权限不足,导致同步失败(这是预期的行为),请前往仓库首页手动执行[Sync fork]。"
  32. echo "::error::Due to insufficient permissions, synchronization failed (as expected). Please go to the repository homepage and manually perform [Sync fork]."
  33. exit 1