Update label_issue.yml

This commit is contained in:
hoshi-hiyouga 2024-06-24 21:59:39 +08:00 committed by GitHub
parent 90c74ff251
commit aa60cd8910
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 11 deletions

View File

@ -13,18 +13,15 @@ jobs:
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_TITLE: "${{ github.event.issue.title }}"
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
gh issue edit $ISSUE_URL --add-label "pending"
# auto-add label for npu
NPU_KEYWORDS=("npu" "ascend" "昇腾")
LABEL_NPU="npu"
ISSUE_TITLE_LOWER=$(echo "$ISSUE_TITLE" | tr '[:upper:]' '[:lower:]')
for keyword in "${NPU_KEYWORDS[@]}"; do
if [[ "$ISSUE_TITLE_LOWER" == *"$keyword"* ]] && [[ "$ISSUE_TITLE_LOWER" != *"input"* ]]; then
gh issue edit "$ISSUE_URL" --add-label "$LABEL_NPU"
LABEL=pending
NPU_KEYWORDS=(npu ascend 昇腾)
ISSUE_TITLE_LOWER=$(echo $ISSUE_TITLE | tr '[:upper:]' '[:lower:]')
for KEYWORD in ${NPU_KEYWORDS[@]}; do
if [[ $ISSUE_TITLE_LOWER == *$KEYWORD* ]] && [[ $ISSUE_TITLE_LOWER != *input* ]] then
LABEL=pending,npu
break
fi
done
gh issue edit $ISSUE_URL --add-label $LABEL