From c4633f945162a64a1ae9a58ce6a29f8b034cda2e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 2 Feb 2021 10:34:45 -0500 Subject: [PATCH] workflows: Add invalid-label-bot.yaml script to warn on invalid tickets Add a tool to add a comment on any issue that has the invalid label added to it. Signed-off-by: Kevin O'Connor --- .github/workflows/invalid-label-bot.yaml | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/invalid-label-bot.yaml diff --git a/.github/workflows/invalid-label-bot.yaml b/.github/workflows/invalid-label-bot.yaml new file mode 100644 index 00000000..33bd0854 --- /dev/null +++ b/.github/workflows/invalid-label-bot.yaml @@ -0,0 +1,40 @@ +# Enable the github stale issue bot tracker +name: "Add comment to issues marked invalid" +on: + issues: + types: [labeled] +jobs: + comment: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + if (context.payload.label.name != "invalid") + return; + msg = "Unfortunately, it appears the directions at" + + " https://www.klipper3d.org/Contact.html" + + " were not followed for this issue.\n" + + "\n" + + "We choose to use github as a place that people working on" + + " improving Klipper can share the results of their work." + + " We choose to not use github to help diagnose problems" + + " with a user's printer. We choose to not use github to" + + " answer user questions. We choose to not use github as" + + " a place to make requests.\n" + + "\n" + + "In the future, please follow the directions at:" + + " https://www.klipper3d.org/Contact.html\n" + + "This ticket will be automatically closed.\n" + + "\n" + + "Best regards,\n" + + "~ Your friendly GitIssueBot\n" + + "\n" + + "PS: I'm just an automated script, not a human being."; + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: msg + })