github: Use action-regex-match action for adding backport label

Seems that labeler does not work properly with comments, tested on my own
local repository.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-11-21 21:05:16 +02:00
parent 9d44fb97a1
commit 3160e84254
3 changed files with 21 additions and 22 deletions

2
.github/labeler.yml vendored
View File

@ -1,2 +0,0 @@
backport:
- '(Mergifyio backport )'

View File

@ -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

View File

@ -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