aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/invalid-label-bot.yaml
blob: 7b44163a1127d887f490d3fc221e8cee0d6da81b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Add a comment to github issues marked with the invalid label
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 = "It looks like this ticket is a request for help"
                + " (or similar)."
                + " Many helpful people will not see your message here and you"
                + " are unlikely to get a useful response."
                + " Instead, see the contact directions at:"
                + " https://www.klipper3d.org/Contact.html"
                + "\n\n"
                + "We use github to share the results of work done to"
                + " improve Klipper. We don't use github for requests."
                + " (In particular, we don't use github for feature"
                + " requests, to answer questions, nor to help diagnose"
                + " problems with a printer.)"
                + "\n\n"
                + "Please follow the directions at:"
                + " https://www.klipper3d.org/Contact.html"
                + "\n\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
            })