2023-04-14 23:53:07 +02:00
|
|
|
name: Check Merge Fast-Forward Only
|
|
|
|
|
2024-08-09 14:39:46 +02:00
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
|
|
|
|
2023-04-14 23:53:07 +02:00
|
|
|
on:
|
2024-08-12 16:45:46 +02:00
|
|
|
push:
|
|
|
|
pull_request_target:
|
|
|
|
pull_request_review:
|
2024-08-12 16:00:50 +02:00
|
|
|
types: [submitted]
|
2023-04-14 23:53:07 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check_merge:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-08-01 19:17:40 +02:00
|
|
|
uses: actions/checkout@v3
|
2023-04-14 23:53:07 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Git
|
|
|
|
run: |
|
|
|
|
git config user.name "GitHub Action"
|
|
|
|
git config user.email "noreply@example.com"
|
|
|
|
|
|
|
|
- name: Check merge --ff-only
|
|
|
|
run: |
|
|
|
|
git fetch origin master:master
|
|
|
|
git checkout master
|
|
|
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
|
|
|
git merge --ff-only ${{ github.event.pull_request.head.sha }}
|
|
|
|
else
|
|
|
|
git merge --ff-only ${{ github.sha }}
|
|
|
|
fi
|
2024-08-09 14:39:46 +02:00
|
|
|
|
|
|
|
- name: add labels
|
|
|
|
uses: actions-ecosystem/action-add-labels@v1
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
labels: |
|
|
|
|
needs rebase
|
|
|
|
|
|
|
|
- name: comment
|
|
|
|
uses: mshick/add-pr-comment@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
message: |
|
|
|
|
This pull request has conflicts, please rebase.
|