ci: check ff after merge into base branch for PRs

This commit is contained in:
UdjinM6 2024-10-24 20:36:41 +03:00
parent aaccc9ea51
commit c76e398caa
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9

View File

@ -26,11 +26,14 @@ jobs:
- name: Check merge --ff-only - name: Check merge --ff-only
run: | run: |
git fetch origin master:master git fetch origin master:master
git checkout master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin pull/${{ github.event.pull_request.number }}/head git fetch origin {{ github.event.pull_request.base.ref }}:base_branch
git merge --ff-only ${{ github.event.pull_request.head.sha }} git checkout base_branch
git pull origin pull/${{ github.event.pull_request.number }}/head
git checkout master
git merge --ff-only base_branch
else else
git checkout master
git merge --ff-only ${{ github.sha }} git merge --ff-only ${{ github.sha }}
fi fi