From 3160e842546a99e7ae82f40a2d67000d67daa066 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 21 Nov 2022 21:05:16 +0200 Subject: [PATCH] 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 --- .github/labeler.yml | 2 -- .github/workflows/labeler.yml | 20 -------------------- .github/workflows/mergifyio_backport.yml | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 .github/labeler.yml delete mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/mergifyio_backport.yml diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index af29289d33..0000000000 --- a/.github/labeler.yml +++ /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 index 9b01cd1b90..0000000000 --- a/.github/workflows/labeler.yml +++ /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 index 0000000000..bca8f34fec --- /dev/null +++ b/.github/workflows/mergifyio_backport.yml @@ -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 -- 2.39.5