From 505f756c98119d9c199586f899b99e94e5f9c699 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Thu, 14 Jan 2021 18:03:21 +0100 Subject: [PATCH] chore: use matrix in PR labeler --- .github/workflows/labeler.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index ba807bea..940a05f3 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -7,24 +7,20 @@ jobs: label-pr: if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false runs-on: ubuntu-latest + strategy: + matrix: + pr: + [ + { prefix: 'fix', type: 'bug' }, + { prefix: 'chore', type: 'chore' }, + { prefix: 'test', type: 'chore' }, + { prefix: 'ci', type: 'chore' }, + { prefix: 'feat', type: 'feature' }, + { prefix: 'security', type: 'security' }, + ] steps: - - uses: erezrokah/pr-labeler-action@v1.0.0 - if: startsWith(github.event.pull_request.title, 'fix') + - uses: netlify/pr-labeler-action@v1.0.0 + if: startsWith(github.event.pull_request.title, matrix.pr.prefix) with: token: '${{ secrets.GITHUB_TOKEN }}' - label: 'type: bug' - - uses: erezrokah/pr-labeler-action@v1.0.0 - if: startsWith(github.event.pull_request.title, 'chore') || startsWith(github.event.pull_request.title, 'ci') - with: - token: '${{ secrets.GITHUB_TOKEN }}' - label: 'type: chore' - - uses: erezrokah/pr-labeler-action@v1.0.0 - if: startsWith(github.event.pull_request.title, 'feat') - with: - token: '${{ secrets.GITHUB_TOKEN }}' - label: 'type: feature' - - uses: erezrokah/pr-labeler-action@v1.0.0 - if: startsWith(github.event.pull_request.title, 'security') - with: - token: '${{ secrets.GITHUB_TOKEN }}' - label: 'type: security' + label: 'type: ${{ matrix.pr.type }}'