Skip to content

Commit 0b8df18

Browse files
authored
chore: use matrix in PR labeler (#360)
1 parent 710819b commit 0b8df18

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

.github/workflows/labeler.yml

+14-18
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,20 @@ jobs:
77
label-pr:
88
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
99
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
pr:
13+
[
14+
{ prefix: 'fix', type: 'bug' },
15+
{ prefix: 'chore', type: 'chore' },
16+
{ prefix: 'test', type: 'chore' },
17+
{ prefix: 'ci', type: 'chore' },
18+
{ prefix: 'feat', type: 'feature' },
19+
{ prefix: 'security', type: 'security' },
20+
]
1021
steps:
11-
- uses: erezrokah/[email protected]
12-
if: startsWith(github.event.pull_request.title, 'fix')
22+
- uses: netlify/[email protected]
23+
if: startsWith(github.event.pull_request.title, matrix.pr.prefix)
1324
with:
1425
token: '${{ secrets.GITHUB_TOKEN }}'
15-
label: 'type: bug'
16-
- uses: erezrokah/[email protected]
17-
if: startsWith(github.event.pull_request.title, 'chore') || startsWith(github.event.pull_request.title, 'ci')
18-
with:
19-
token: '${{ secrets.GITHUB_TOKEN }}'
20-
label: 'type: chore'
21-
- uses: erezrokah/[email protected]
22-
if: startsWith(github.event.pull_request.title, 'feat')
23-
with:
24-
token: '${{ secrets.GITHUB_TOKEN }}'
25-
label: 'type: feature'
26-
- uses: erezrokah/[email protected]
27-
if: startsWith(github.event.pull_request.title, 'security')
28-
with:
29-
token: '${{ secrets.GITHUB_TOKEN }}'
30-
label: 'type: security'
26+
label: 'type: ${{ matrix.pr.type }}'

0 commit comments

Comments
 (0)