Update README.md #58
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: Update Branches | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-branches: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get branch names | |
id: branches | |
run: | | |
git ls-remote --heads origin | awk -F'/' '{print $3}' | grep -vE '^(main|legacy)$' > ${{ github.workspace }}/branches.txt | |
- name: Update branches | |
run: | | |
git config --global user.email "anirudhaanekal@gmail.com" | |
git config --global user.name "Wambyat" | |
while read -r branch; do | |
git checkout $branch | |
git merge origin/main --no-edit | |
git push origin $branch | |
done < ${{ github.workspace }}/branches.txt |