auto-merge.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Auto Merge Main to Other Branches
  2. on:
  3. push:
  4. branches:
  5. - main
  6. workflow_dispatch: # 手动触发
  7. jobs:
  8. merge-to-base:
  9. name: Merge main into base
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout repository
  13. uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. token: ${{ secrets.GH_TOKEN_AUTO_MERGE }}
  17. - name: Merge main into base
  18. run: |
  19. git config user.name "GitHub Actions"
  20. git config user.email "actions@github.com"
  21. git checkout base
  22. git merge main --no-ff -m "Auto merge main into base"
  23. git push origin base
  24. - name: Merge base into base-login
  25. run: |
  26. git config user.name "GitHub Actions"
  27. git config user.email "actions@github.com"
  28. git checkout base-login
  29. git merge base --no-ff -m "Auto merge base into base-login"
  30. git push origin base-login
  31. - name: Merge base into base-i18n
  32. run: |
  33. git config user.name "GitHub Actions"
  34. git config user.email "actions@github.com"
  35. git checkout base-i18n
  36. git merge base --no-ff -m "Auto merge base into base-i18n"
  37. git push origin base-i18n
  38. - name: Merge base into base-login-i18n
  39. run: |
  40. git config user.name "GitHub Actions"
  41. git config user.email "actions@github.com"
  42. git checkout base-login-i18n
  43. git merge base --no-ff -m "Auto merge base into base-login-i18n"
  44. git push origin base-login-i18n