add some magic to merge to parent branch

This commit make it merge to parent branch instead of `master` branch, i.e. you are working on a branch called `refactor` and making a branch `release/2.0`, changes will be applied to `refactor` instead of `master`.
This commit is contained in:
Aleksana 2022-08-15 13:11:10 +08:00 committed by GitHub
parent 8500873387
commit dd944cb5a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,13 @@ jobs:
- name: Merge branch and push - name: Merge branch and push
run: | run: |
git checkout master parent=$(git show-branch \
| grep -F '*' \
| grep -v "$(git rev-parse --abbrev-ref HEAD)" \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//')
git checkout ${parent}
git merge release/${{ env.BUILDVER }} --allow-unrelated-histories git merge release/${{ env.BUILDVER }} --allow-unrelated-histories
git pull && git push && git push --tags git pull && git push && git push --tags