Skip to content

Update All Branches #10

Update All Branches

Update All Branches #10

name: Update All Branches
on:
workflow_run:
workflows: ["Synchronize to main"]
types:
- completed
jobs:
update-branches:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up git
run: |
git config --global user.name 'Vustron'
git config --global user.email 'vustronvustronus@gmail.com'
- name: Fetch all branches
run: git fetch --all
- name: Update all branches
run: |
git branch -r | grep -v '\->' | while read remote; do
branch="${remote#origin/}"
if [ "$branch" != "main" ] && [ "$branch" != "HEAD" ]; then
git checkout "$branch"
git merge origin/main --no-edit || true
git push origin "$branch"
fi
done