Skip to content

Commit

Permalink
Update update-feature-branches.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Carvin-Yu authored Jan 7, 2024
1 parent c642089 commit e0a30fc
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/update-feature-branches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,13 @@ jobs:
run: |
git fetch --unshallow
git pull
process_branch() {
local branch=$1
branch_name=$(echo $branch | sed 's/origin\///')
git checkout -B $branch_name $branch
git pull
git merge --no-ff main -m "Auto-merge master back to $branch_name"
git push origin $branch_name
}
trap 'process_branch' ERR
for branch in $(git branch -r --list "origin/feature/*"); do
git pull
git merge --quit
git clean -f
git reset --hard HEAD
if ! process_branch $branch; then
continue
git checkout -b "$branch" "origin/$branch"
git merge main
if [ $? -ne 0 ]; then
git merge --abort
git reset --hard HEAD
fi
done
Expand Down

0 comments on commit e0a30fc

Please sign in to comment.