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 5710ca0 commit c19b7cf
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ on:
push:
branches:
- 'release/*'
pull_request_target:
types: [opened, synchronize]
branches:
- 'release/*'

jobs:
block_merge:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check for 'Merge branch develop' Commits
if: |
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."
exit 1
fi
- name: Show Base Branch
run: "echo Base Branch: ${{ github.event.pull_request.base.ref }}"

- name: Show Head Branch
run: "echo Head Branch: ${{ github.event.pull_request.head.ref }}"

# - name: Check for 'Merge branch develop' Commits
# if: |
# github.event.pull_request.base.ref == 'develop' &&
# github.event.pull_request.head.ref == 'release/*'
#
# run: |
# set -e
# git fetch origin "+refs/pull/${{ github.event.pull_request.number }}/merge:"
# if git log --merges --pretty=format:'%s' FETCH_HEAD | grep -q "Merge branch 'develop'"; then
# echo "ERROR: This Pull Request contains a merge commit from 'develop'. Merging from 'develop' is not allowed."
# exit 1
# fi

0 comments on commit c19b7cf

Please sign in to comment.