add all labels

This commit is contained in:
0xSage 2023-12-01 14:51:05 +08:00
parent e3b39819c6
commit d489357da0

View File

@ -21,22 +21,21 @@ jobs:
- name: Label issues
run: |
ISSUE_TITLE=$(gh issue view ${{ github.event.number }} --json title -q ".title")
if [[ $ISSUE_TITLE == chore:* ]]; then
gh issue edit ${{ github.event.number }} --add-label "type: chore"
elif [[ $ISSUE_TITLE == feat:* ]]; then
gh issue edit ${{ github.event.number }} --add-label "type: feat"
case "$ISSUE_TITLE" in
chore:*) LABEL="type: chore" ;;
feat:*) LABEL="type: feature request" ;;
perf:*) LABEL="type: enhancement" ;;
fix:*) LABEL="type: bug" ;;
docs:*) LABEL="type: documentation" ;;
ci:*) LABEL="type: ci" ;;
build:*) LABEL="type: ci" ;;
test:*) LABEL="type: chore" ;;
style:*) LABEL="type: chore" ;;
refactor:*) LABEL="type: chore" ;;
*) LABEL="" ;;
esac
if [ -n "$LABEL" ]; then
gh issue edit ${{ github.event.number }} --add-label "$LABEL"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# const labelMapping = {
# 'feat:': 'type: feature request',
# 'perf:': 'type: enhancement',
# 'fix:': 'type: bug',
# 'docs:': 'type: documentation',
# 'ci:': 'type: ci',
# 'build:': 'type: ci',
# 'chore:': 'type: chore',
# 'test:': 'type: chore',
# 'style:': 'type: chore',
# 'refactor:': 'type: chore',
# };