Skip to content

Commit 7de7197

Browse files
committed
ci: assign label based on conventional commits
1 parent bf0d37b commit 7de7197

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/labels.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Conventional Commit Labels
2+
on:
3+
pull_request_target:
4+
types: [opened, synchronize, reopened]
5+
6+
jobs:
7+
assign-labels:
8+
runs-on: ubuntu-latest
9+
name: Assign labels in pull request
10+
if: github.event.pull_request.merged == false
11+
steps:
12+
- name: Execute assign labels
13+
id: action-assign-labels
14+
uses: mauroalderete/action-assign-labels@v1
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
conventional-commits: |
18+
conventional-commits:
19+
- type: 'fix'
20+
nouns: ['FIX', 'Fix', 'fix', 'FIXED', 'Fixed', 'fixed']
21+
labels: ['bug']
22+
- type: 'feature'
23+
nouns: ['FEATURE', 'Feature', 'feature', 'FEAT', 'Feat', 'feat']
24+
labels: ['feature']
25+
- type: 'docs'
26+
nouns: ['DOCS', 'Docs', 'docs']
27+
labels: ['docs']
28+
- type: 'refactor'
29+
nouns: ['REFACTOR', 'Refactor', 'refactor']
30+
labels: ['refactor']
31+
- type: 'test'
32+
nouns: ['TEST', 'Test', 'test']
33+
labels: ['test']
34+
- type: 'style'
35+
nouns: ['STYLE', 'Style', 'style']
36+
labels: ['style']
37+
- type: 'chore'
38+
nouns: ['CHORE', 'Chore', 'chore']
39+
labels: ['chore']
40+
- type: 'ci'
41+
nouns: ['CI', 'Ci', 'ci']
42+
labels: ['ci']
43+
- type: 'perf'
44+
nouns: ['PERF', 'Perf', 'perf']
45+
labels: ['perf']
46+
- type: 'breaking_change'
47+
nouns: ['BREAKING CHANGE', 'BREAKING', 'MAJOR']
48+
labels: ['BREAKING CHANGE']
49+

0 commit comments

Comments
 (0)