From d470bf2dd97ede837cbdf2083a13379175b8c106 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Mon, 10 Mar 2025 01:01:12 +0800 Subject: [PATCH] rm: label issues workflow --- .github/workflows/label_issue.yml | 60 ------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 .github/workflows/label_issue.yml diff --git a/.github/workflows/label_issue.yml b/.github/workflows/label_issue.yml deleted file mode 100644 index b6ce0c6a..00000000 --- a/.github/workflows/label_issue.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Label Issue - -on: - workflow_dispatch: - issues: - types: [opened, edited] - -jobs: - label-issue: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Label issue if it contains "windows" - uses: actions/github-script@v7 - with: - script: | - const { data: issue } = await github.rest.issues.get({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); - - const labelsToAdd = []; - const existingLabels = issue.labels.map(label => label.name); - const bodyContent = issue.body.toLowerCase(); - - // Check for keywords and add corresponding labels - if (bodyContent.includes('windows')) { - labelsToAdd.push('windows'); - } - if (bodyContent.includes('linux')) { - labelsToAdd.push('linux'); - } - if (bodyContent.includes('macos')) { - labelsToAdd.push('macos'); - } - - if (bodyContent.includes("托盘") || bodyContent.includes("tray")) { - labelsToAdd.push('tray'); - } - - if (bodyContent.includes("菜单") || bodyContent.includes("menu")) { - labelsToAdd.push('menu'); - } - - // Add labels if any match - // Filter out labels that already exist to avoid duplication - const newLabelsToAdd = labelsToAdd.filter(label => !existingLabels.includes(label)); - - // Add labels if there are new ones to add - if (newLabelsToAdd.length > 0) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: newLabelsToAdd, - }); - }