-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1.07 KB
/
labels.yaml
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
31
name: Add labels when pull request is opened
on: [pull_request, workflow_dispatch]
jobs:
add-label:
name: Add labels on pull request
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- run: |
if [[ "${{ github.head_ref }}" == chore/* ]]; then
LABEL="chore :construction_worker_man:"
else
if [[ "${{ github.head_ref }}" == feature/* ]]; then
LABEL="enhancement :rocket:"
else
if [[ "${{ github.head_ref }}" == feat/* ]]; then
LABEL="enhancement :rocket:"
else
if [[ "${{ github.head_ref }}" == fix/* ]]; then
LABEL="bug :bug:"
else
LABEL="other"
fi
fi
fi
fi
gh pr edit $ISSUE --add-label "$LABEL"
gh pr comment $ISSUE --body "Label $LABEL has been added to this pull request"
env:
GH_TOKEN: ${{ github.token }}
ISSUE: ${{ github.event.pull_request.html_url }}