From c680f674f2d5792640c5f58bfd0e0698ca615474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=A8=F0=9F=87=B3=E9=92=9F=E6=99=BA=E5=BC=BA=20?= =?UTF-8?q?=E3=80=8E=E6=B1=9F=E8=A5=BF=E9=9D=92=E5=9E=A3=E7=A7=91=E6=8A=80?= =?UTF-8?q?=E3=80=8F?= Date: Sun, 12 Oct 2025 15:35:39 +0800 Subject: [PATCH 1/3] (feat) added a simple workflows to prevent github issue spam #1004 --- .github/workflows/issue-handler.yml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/issue-handler.yml diff --git a/.github/workflows/issue-handler.yml b/.github/workflows/issue-handler.yml new file mode 100644 index 0000000..a5f44c3 --- /dev/null +++ b/.github/workflows/issue-handler.yml @@ -0,0 +1,52 @@ +name: Issue Auto Handler + +on: + issues: + types: [opened, edited] + +jobs: + manage-issues: + runs-on: ubuntu-latest + steps: + - name: Run issue triage bot + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue = context.payload.issue + const body = issue.body?.toLowerCase() || "" + + // Rules + const spamKeywords = ["pls fix", "help me", "urgent", "asap", "???", "wtf"] + const isSpam = spamKeywords.some(k => body.includes(k)) + + if (isSpam) { + await github.rest.issues.addLabels({ + ...context.repo, + issue_number: issue.number, + labels: ['spam'] + }) + + await github.rest.issues.createComment({ + ...context.repo, + issue_number: issue.number, + body: " This issue seems incomplete or low-effort. Please follow the issue template or provide more details. Thanks!" + }) + + await github.rest.issues.lock({ + ...context.repo, + issue_number: issue.number, + lock_reason: "off-topic" + }) + } else { + await github.rest.issues.addLabels({ + ...context.repo, + issue_number: issue.number, + labels: ['triage'] + }) + await github.rest.issues.createComment({ + ...context.repo, + issue_number: issue.number, + body: "Thanks for the report! Our team will check this soon " + }) + } From f1db6e76e07a545af888c01b77c3710dff4401a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=A8=F0=9F=87=B3=E9=92=9F=E6=99=BA=E5=BC=BA=20?= =?UTF-8?q?=E3=80=8E=E6=B1=9F=E8=A5=BF=E9=9D=92=E5=9E=A3=E7=A7=91=E6=8A=80?= =?UTF-8?q?=E3=80=8F?= Date: Sun, 12 Oct 2025 15:37:38 +0800 Subject: [PATCH 2/3] (feat) added a simple workflows to prevent github issue spam #1004 --- .github/workflows/issue-handler.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/issue-handler.yml b/.github/workflows/issue-handler.yml index a5f44c3..1d3ca5a 100644 --- a/.github/workflows/issue-handler.yml +++ b/.github/workflows/issue-handler.yml @@ -16,7 +16,6 @@ jobs: const issue = context.payload.issue const body = issue.body?.toLowerCase() || "" - // Rules const spamKeywords = ["pls fix", "help me", "urgent", "asap", "???", "wtf"] const isSpam = spamKeywords.some(k => body.includes(k)) From 4c786a9055a48ca2ed7f205eea7dc9561d44a9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=A8=F0=9F=87=B3=E9=92=9F=E6=99=BA=E5=BC=BA=20?= =?UTF-8?q?=E3=80=8E=E6=B1=9F=E8=A5=BF=E9=9D=92=E5=9E=A3=E7=A7=91=E6=8A=80?= =?UTF-8?q?=E3=80=8F?= Date: Sun, 12 Oct 2025 15:38:02 +0800 Subject: [PATCH 3/3] (feat) added a simple workflows to prevent github issue spam #1004 --- .github/workflows/issue-handler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-handler.yml b/.github/workflows/issue-handler.yml index 1d3ca5a..9315e71 100644 --- a/.github/workflows/issue-handler.yml +++ b/.github/workflows/issue-handler.yml @@ -16,7 +16,7 @@ jobs: const issue = context.payload.issue const body = issue.body?.toLowerCase() || "" - const spamKeywords = ["pls fix", "help me", "urgent", "asap", "???", "wtf"] + const spamKeywords = ["pls fix", "help me", "urgent", "asap", "???", "wtf"] // add more keywords here if needed in the futrue const isSpam = spamKeywords.some(k => body.includes(k)) if (isSpam) {