From 52f095afeeb48790fa84bb45c17fc14a00d787d1 Mon Sep 17 00:00:00 2001 From: Yevhenii Kovalenko Date: Wed, 6 Mar 2024 22:30:35 +0100 Subject: [PATCH] release branch: change workflow --- .github/workflows/pr.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index cfd688e..0491e84 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,11 +1,17 @@ name: Block Pull Requests with 'Merge branch develop' Commits on: - pull_request: null + push: + branches: + - 'release/*' + pull_request_target: + types: [opened, synchronize] + branches: + - 'release/*' jobs: block_merge: - runs-on: "ubuntu-20.04" + runs-on: ubuntu-20.04 steps: - name: Checkout code @@ -13,10 +19,8 @@ jobs: - name: Check for 'Merge branch develop' Commits if: | - ( - github.event.pull_request.head.ref == 'release/*' && - github.event.pull_request.base.ref == 'develop' - ) + github.event.pull_request.base.ref == 'develop' && + github.event.pull_request.head.ref == 'release/*' run: | if git log --merges --ancestry-path HEAD^..HEAD --pretty=format:%s | grep -q "Merge branch 'develop'"; then echo "ERROR: This Pull Request contains a merge commit from 'develop'. Merging from 'develop' is not allowed."