klipper/.github/workflows/invalid-label-bot.yaml

40 lines
1.5 KiB
YAML

# 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 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"
+ "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
})