auto-label npu issue

This commit is contained in:
MengqingCao
2024-06-24 12:27:00 +00:00
parent 4ea84a8333
commit 90c74ff251

View File

@@ -13,5 +13,18 @@ jobs:
- env: - env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }} ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_TITLE: "${{ github.event.issue.title }}"
run: | run: |
gh issue edit $ISSUE_URL --add-label "pending" 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"
break
fi
done