Skip to content

Commit 952250a

Browse files
authored
Update main-merge.yml
1 parent 56ea815 commit 952250a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/main-merge.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626
run: |
2727
git fetch --all # Ensures all branches are fetched from origin
2828
29-
# List of all remote branches excluding `main`
29+
# List all remote branches excluding `main`
3030
BRANCHES=$(git branch -r | grep -Eo "origin/[^/]+" | sed 's/origin\///' | grep -vE '^(main)$')
3131
3232
# Loop through each branch
3333
for branch in $BRANCHES; do
3434
echo "Merging main into $branch..."
3535
36-
# Checkout the branch
37-
git checkout $branch
36+
# Checkout the branch (ensuring we escape any special characters)
37+
git checkout "$branch"
3838
3939
# Pull the latest changes from the remote branch
40-
git pull origin $branch --rebase # Using rebase to avoid merge commits
40+
git pull origin "$branch" --rebase # Using rebase to avoid merge commits
4141
4242
# Merge the main branch into the current branch
4343
git merge --no-edit origin/main || echo "No new changes to merge or merge conflict detected"
@@ -49,5 +49,5 @@ jobs:
4949
fi
5050
5151
# Push the updated branch back to origin
52-
git push origin $branch
52+
git push origin "$branch"
5353
done

0 commit comments

Comments
 (0)