From c76e398caaccf2cde98efdea8e09c394175996ed Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 24 Oct 2024 20:36:41 +0300 Subject: [PATCH] ci: check ff after merge into base branch for PRs --- .github/workflows/merge-check.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml index fb45e3775c..8ff89b94ca 100644 --- a/.github/workflows/merge-check.yml +++ b/.github/workflows/merge-check.yml @@ -26,11 +26,14 @@ jobs: - name: Check merge --ff-only run: | git fetch origin master:master - git checkout master if [[ "${{ github.event_name }}" == "pull_request"* ]]; then - git fetch origin pull/${{ github.event.pull_request.number }}/head - git merge --ff-only ${{ github.event.pull_request.head.sha }} + git fetch origin {{ github.event.pull_request.base.ref }}:base_branch + git checkout base_branch + git pull origin pull/${{ github.event.pull_request.number }}/head + git checkout master + git merge --ff-only base_branch else + git checkout master git merge --ff-only ${{ github.sha }} fi