From bd0e45d723a24151bb3f85050cda5804913eee25 Mon Sep 17 00:00:00 2001 From: Grzegorz Klimaszewski <166530809+grzegorz-roboflow@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:07:38 +0100 Subject: [PATCH] Make check_if_branch_is_mergeable.yml to succeed if merging to main --- .github/workflows/check_if_branch_is_mergeable.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check_if_branch_is_mergeable.yml b/.github/workflows/check_if_branch_is_mergeable.yml index 727ae3f90..bebfc9be4 100644 --- a/.github/workflows/check_if_branch_is_mergeable.yml +++ b/.github/workflows/check_if_branch_is_mergeable.yml @@ -30,6 +30,10 @@ jobs: - name: Check and store mergable state id: mergeable_check run: | + if [ -z "${{ github.event.pull_request.head.sha }}" ]; then + echo "Merging to main"; + exit 0; + fi echo "Check if main is ancestor of ${{ github.event.pull_request.head.sha }} (branch HEAD)"; if $(git merge-base --is-ancestor ${{ env.main_sha }} ${{ github.event.pull_request.head.sha }}); then echo "Branch is mergeable";