From d489357da06d2a8eb179f1e6e9317f773e99226b Mon Sep 17 00:00:00 2001 From: 0xSage Date: Fri, 1 Dec 2023 14:51:05 +0800 Subject: [PATCH] add all labels --- .../auto-label-conventional-commits.yaml | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/auto-label-conventional-commits.yaml b/.github/workflows/auto-label-conventional-commits.yaml index d7ff946628..9fe9a39eaa 100644 --- a/.github/workflows/auto-label-conventional-commits.yaml +++ b/.github/workflows/auto-label-conventional-commits.yaml @@ -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', -# };