From 5394d63e18a8d6c5d6747147e6572bc08228812e Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 9 Aug 2024 19:39:46 +0700 Subject: [PATCH] feat: improve merge-check action to leave a comment and label to PRs --- .github/workflows/merge-check.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml index 52a0aed076..caaa98863e 100644 --- a/.github/workflows/merge-check.yml +++ b/.github/workflows/merge-check.yml @@ -1,8 +1,12 @@ name: Check Merge Fast-Forward Only +permissions: + pull-requests: write + on: - push: - pull_request: + - push + - pull_request_target + - pull_request_review jobs: check_merge: @@ -27,3 +31,17 @@ jobs: else git merge --ff-only ${{ github.sha }} 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.