triageBugs.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Bug Report Triage
  2. on:
  3. issues:
  4. types: [opened]
  5. jobs:
  6. closeTemplateViolation:
  7. name: Validate bug report against issue template
  8. runs-on: ubuntu-latest
  9. if: contains(github.event.issue.labels.*.name, 'type:bug')
  10. steps:
  11. - name: Check "Description"
  12. if: |
  13. !contains(github.event.issue.body, env.MUST_CONTAIN)
  14. || contains(toJson(github.event.issue.body), env.MUST_NOT_CONTAIN)
  15. run: exit 1
  16. env:
  17. MUST_CONTAIN: '### Description'
  18. MUST_NOT_CONTAIN: '### Description\r\n\r\n[Summarize your problem.]\r\n\r\n### System Setup'
  19. - name: Check "Steps to Reproduce"
  20. if: |
  21. !contains(github.event.issue.body, env.MUST_CONTAIN)
  22. || contains(toJson(github.event.issue.body), env.MUST_NOT_CONTAIN)
  23. run: exit 1
  24. env:
  25. MUST_CONTAIN: '### Steps to Reproduce'
  26. MUST_NOT_CONTAIN: '### Steps to Reproduce\r\n\r\n1. [First step]\r\n2. [Second step]\r\n3. [and so on…]\r\n\r\n#### Expected Behavior'
  27. - name: Close issue if one of the checks failed
  28. if: ${{ failure() }}
  29. uses: peter-evans/close-issue@v1
  30. with:
  31. comment: |
  32. This bug report did ignore our issue template. 😞
  33. Auto-closing this issue, since it is most likely not useful.
  34. _This decision was made by a bot. If you think the bot is wrong, let us know and we'll reopen this issue._