sync-main-on-release.yml 670 B

1234567891011121314151617181920212223242526272829
  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. token: ${{ secrets.PAT_TOKEN }}
  18. - name: Configure Git
  19. run: |
  20. git config --global user.name "github-actions[bot]"
  21. git config --global user.email "github-actions[bot]@users.noreply.github.com"
  22. - name: Force push dev to main
  23. run: |
  24. git fetch origin
  25. git push origin dev:main --force