Skip to content

Commit

Permalink
ci: do not check --ff-only on master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Dec 14, 2024
1 parent 779e429 commit dcc1ff3
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/merge-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ jobs:
- name: Check merge --ff-only
run: |
git fetch origin master:master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin ${{ github.event.pull_request.base.ref }}:base_branch
git checkout base_branch
git pull --rebase=false origin pull/${{ github.event.pull_request.number }}/head
git checkout master
git merge --ff-only base_branch
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "Already on master, no need to check --ff-only"
else
git checkout master
git merge --ff-only ${{ github.sha }}
git fetch origin master:master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin ${{ github.event.pull_request.base.ref }}:base_branch
git checkout base_branch
git pull --rebase=false 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
fi
- name: add labels
Expand Down

0 comments on commit dcc1ff3

Please sign in to comment.