Skip to content

Enhance release notes & release creation #33

Enhance release notes & release creation

Enhance release notes & release creation #33

# 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 }}