feat: improve merge-check action to leave a comment and label to PRs

This commit is contained in:
pasta 2024-08-09 19:39:46 +07:00
parent 117dda9d6f
commit 5394d63e18
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -1,8 +1,12 @@
name: Check Merge Fast-Forward Only name: Check Merge Fast-Forward Only
permissions:
pull-requests: write
on: on:
push: - push
pull_request: - pull_request_target
- pull_request_review
jobs: jobs:
check_merge: check_merge:
@ -27,3 +31,17 @@ jobs:
else else
git merge --ff-only ${{ github.sha }} git merge --ff-only ${{ github.sha }}
fi fi
- 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.