-
Notifications
You must be signed in to change notification settings - Fork 4
28 lines (25 loc) · 950 Bytes
/
Copy pathpr-labeler.yml
File metadata and controls
28 lines (25 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: PR Labeler
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
label-pr:
runs-on: ubuntu-latest
steps:
- name: Extract branch name
id: extract_branch
run: echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Add labels based on branch name
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
${{ startsWith(env.branch_name, 'feature/') && 'feature' || '' }}
${{ startsWith(env.branch_name, 'fix/') && 'bug' || '' }}
${{ startsWith(env.branch_name, 'enhancement/') && 'enhancement' || '' }}
${{ startsWith(env.branch_name, 'optimization/') && 'optimization' || '' }}
${{ startsWith(env.branch_name, 'refactor/') && 'refactor' || '' }}
${{ startsWith(env.branch_name, 'chore/') && 'chore' || '' }}