]> git.proxmox.com Git - mirror_frr.git/commitdiff
github: Use `action-regex-match` action for adding `backport` label
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 21 Nov 2022 19:05:16 +0000 (21:05 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 21 Nov 2022 19:06:40 +0000 (21:06 +0200)
Seems that labeler does not work properly with comments, tested on my own
local repository.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
.github/labeler.yml [deleted file]
.github/workflows/labeler.yml [deleted file]
.github/workflows/mergifyio_backport.yml [new file with mode: 0644]

diff --git a/.github/labeler.yml b/.github/labeler.yml
deleted file mode 100644 (file)
index af29289..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-backport:
-  - '(Mergifyio backport )'
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml
deleted file mode 100644 (file)
index 9b01cd1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-name: Labeler
-
-on:
-  pull_request_target:
-    types:
-      - opened
-      - reopened
-
-jobs:
-  labeler:
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-      pull-requests: write
-    steps:
-    - uses: github/issue-labeler@v2.5
-      with:
-        repo-token: "${{ secrets.GITHUB_TOKEN }}"
-        configuration-path: .github/labeler.yml
-        enable-versioned-regex: 0
diff --git a/.github/workflows/mergifyio_backport.yml b/.github/workflows/mergifyio_backport.yml
new file mode 100644 (file)
index 0000000..bca8f34
--- /dev/null
@@ -0,0 +1,21 @@
+name: Mergifyio backport
+
+on: [issue_comment]
+
+jobs:
+  mergifyio_backport:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - uses: actions-ecosystem/action-regex-match@v2
+        id: regex-match
+        with:
+          text: ${{ github.event.comment.body }}
+          regex: '[Mm]ergifyio backport '
+
+      - uses: actions-ecosystem/action-add-labels@v1
+        if: ${{ steps.regex-match.outputs.match != '' }}
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          labels: backport