]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
github: add action to manage needs-rebase label 38548/head
authorErnesto Puerta <epuertat@redhat.com>
Fri, 11 Dec 2020 20:24:35 +0000 (21:24 +0100)
committerErnesto Puerta <epuertat@redhat.com>
Tue, 15 Dec 2020 18:09:28 +0000 (19:09 +0100)
Fixes: https://tracker.ceph.com/issues/48570
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
.github/workflows/needs-rebase.yml [new file with mode: 0644]

diff --git a/.github/workflows/needs-rebase.yml b/.github/workflows/needs-rebase.yml
new file mode 100644 (file)
index 0000000..d9e2c70
--- /dev/null
@@ -0,0 +1,18 @@
+---
+name: "Pull Request Needs Rebase?"
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]
+jobs:
+  needs-rebase:
+    runs-on: ubuntu-latest
+    steps:
+      # eps1lon/actions-label-merge-conflict@v2.0.1
+      # (NOTE: pinning the action to a given commit is a security best-practice:
+      # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions)
+      - name: Check if PR needs rebase
+        uses: eps1lon/actions-label-merge-conflict@b8bf8341285ec9a4567d4318ba474fee998a6919
+        with:
+          repoToken: "${{ secrets.GITHUB_TOKEN }}"
+          dirtyLabel: "needs-rebase"
+          commentOnDirty: "This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved"