-
Notifications
You must be signed in to change notification settings - Fork 60
31 lines (29 loc) · 1.18 KB
/
label.yml
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
29
30
name: Label
on:
pull_request_target:
types: [opened, edited]
# make sure you have the following labels:
# [documentation, enhancement, bug_fix, refactoring, chore]
jobs:
pr_label:
name: PR label
permissions:
pull-requests: write
contents: read
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- run: gh pr edit $PR --remove-label documentation --remove-label enhancement --remove-label bug_fix --remove-label refactoring --remove-label chore
- run: gh pr edit $PR --add-label documentation
if: ${{ startsWith(github.event.pull_request.title, 'doc') }}
- run: gh pr edit $PR --add-label enhancement
if: ${{ startsWith(github.event.pull_request.title, 'feat') }}
- run: gh pr edit $PR --add-label bug_fix
if: ${{ startsWith(github.event.pull_request.title, 'fix') }}
- run: gh pr edit $PR --add-label refactoring
if: ${{ startsWith(github.event.pull_request.title, 'refact') }}
- run: gh pr edit $PR --add-label chore
if: ${{ startsWith(github.event.pull_request.title, 'chore') }}