From 5b42fc02a344c6b2e47ac009fe4a9d5a7ce30f99 Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:58:20 +0100 Subject: [PATCH] [bot] automatically handle 'Copy issue body from' and 'Please install it via your package manager' issues (#36588) --- .github/workflows/check_issues.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/check_issues.yml b/.github/workflows/check_issues.yml index 5aa7d20187..d0ab9a764f 100644 --- a/.github/workflows/check_issues.yml +++ b/.github/workflows/check_issues.yml @@ -42,3 +42,24 @@ jobs: await github.rest.issues.createComment({...issue_query, body}); // Close the issue? } + + // Issue text is: Copy issue body from .../issue_body.md + reg = /^Copy issue body from .*issue_body.md$/; + if (reg.test(issue.data.body)){ + await github.rest.issues.removeAllLabels(issue_query); + await github.rest.issues.setLabels({...issue_query, labels: ["requires:more-information"]}); + let body = "Please see #30604 for how to report a build failure." + await github.rest.issues.createComment({...issue_query, body}); + await github.rest.issues.update({...issue_query, state: "closed"}); + } + + // pkg-config/ not found issues like #36011 + reg = /CMake Error at scripts\/cmake\/vcpkg_find_acquire_program.*\r\n(.*Please install it via your package manager:[\s\S]+)Call Stack/; + match = issue.data.body.match(reg) + if (match){ + await github.rest.issues.removeAllLabels(issue_query); + await github.rest.issues.setLabels({...issue_query, labels: ["category:question"]}); + let body = "From the log:\n```\n" + match[1] + "```\n" + await github.rest.issues.createComment({...issue_query, body}); + await github.rest.issues.update({...issue_query, state: "closed"}); + }