Enhance release notes & release creation #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow automatically merges the 'main' branch into 'dev' and 'release' branches | |
| # whenever changes are pushed to 'main', without requiring manual confirmation. | |
| name: Merge Main to branches | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| merge-to-branch: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| branch: [ 'dev', 'release' ] | |
| name: main -> ${{ matrix.branch }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Merge main into ${{ matrix.branch }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if ! git checkout ${{ matrix.branch }}; then | |
| echo "[INFO] Branch '${{ matrix.branch }}' does not exist. Skipping merge." | |
| exit 0 | |
| fi | |
| if ! git merge --no-ff origin/main -m "chore: merge main into ${{ matrix.branch }} [skip ci]"; then | |
| echo "[ERROR] Merge conflict detected when merging main into ${{ matrix.branch }}. Manual intervention required." | |
| exit 1 | |
| fi | |
| git push origin ${{ matrix.branch }} |