sync-main-on-release.yml 628 B

12345678910111213141516171819202122232425262728
  1. name: Sync branch
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [published]
  6. branches: [dev]
  7. jobs:
  8. force-push-main:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout repository
  12. uses: actions/checkout@v4
  13. with:
  14. fetch-depth: 0
  15. ref: dev
  16. clean: false
  17. - name: Configure Git
  18. run: |
  19. git config --global user.name "github-actions[bot]"
  20. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  21. - name: Force push dev to main
  22. run: |
  23. git fetch origin
  24. git push origin dev:main --force