[FIXED][DEV1.1.0][OWNER] #5
This file contains 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
name: Merge Main into All Branches | |
on: | |
push: | |
branch: | |
- main | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get branch names | |
id: branches | |
run: | | |
git ls-remote --heads origin | awk -F'/' '{print $3}' | grep -vE 'main$' > ${{ github.workspace }}/branches.txt | |
- name: Merge main into branches | |
run: | | |
while read -r branch; do | |
git config --global user.email "73410627+JohnKun136NVCP@users.noreply.github.com" | |
git config --global user.name "JohnKun136NVCP" | |
git checkout "$branch" | |
git pull | |
git merge --no-ff main -m "Auto-merge main into $branch" | |
git push origin $branch | |
done < ${{ github.workspace }}/branches.txt |