From 90c74ff2519229eb1e509d62426ca3b5e83ef03e Mon Sep 17 00:00:00 2001 From: MengqingCao Date: Mon, 24 Jun 2024 12:27:00 +0000 Subject: [PATCH 1/3] auto-label npu issue --- .github/workflows/label_issue.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/label_issue.yml b/.github/workflows/label_issue.yml index b9a5543c..352b4b25 100644 --- a/.github/workflows/label_issue.yml +++ b/.github/workflows/label_issue.yml @@ -13,5 +13,18 @@ jobs: - env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_URL: ${{ github.event.issue.html_url }} + 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" + break + fi + done From aa60cd8910e5ad2ede574e892522f34e43f59f2f Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Mon, 24 Jun 2024 21:59:39 +0800 Subject: [PATCH 2/3] Update label_issue.yml --- .github/workflows/label_issue.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/label_issue.yml b/.github/workflows/label_issue.yml index 352b4b25..507b6be7 100644 --- a/.github/workflows/label_issue.yml +++ b/.github/workflows/label_issue.yml @@ -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 From 80d1910a93213b18c94e122b7e48cba0a20fd4e6 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Mon, 24 Jun 2024 22:01:23 +0800 Subject: [PATCH 3/3] Update label_issue.yml --- .github/workflows/label_issue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label_issue.yml b/.github/workflows/label_issue.yml index 507b6be7..0e10f0b9 100644 --- a/.github/workflows/label_issue.yml +++ b/.github/workflows/label_issue.yml @@ -19,7 +19,7 @@ jobs: 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 + if [[ $ISSUE_TITLE_LOWER == *$KEYWORD* ]] && [[ $ISSUE_TITLE_LOWER != *input* ]]; then LABEL=pending,npu break fi