Skip to content

Commit

Permalink
release branch: change workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yekovalenkoa committed Mar 6, 2024
1 parent 9fb567f commit 52f095a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
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
uses: actions/checkout@v2

- 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."
Expand Down

0 comments on commit 52f095a

Please sign in to comment.