commentCommands.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: commentCommands
  2. on:
  3. issue_comment:
  4. types: created
  5. jobs:
  6. assign-commenter:
  7. runs-on: ubuntu-latest
  8. if: |
  9. contains(github.event.comment.body, '/assignme') ||
  10. contains(github.event.comment.body, '/assign me')
  11. steps:
  12. - name: Assigning to commenter
  13. run: |
  14. curl \
  15. -X POST \
  16. -H "Accept: application/vnd.github+json" \
  17. -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
  18. https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \
  19. -d '{"assignees":["${{ github.event.comment.user.login }}"]}'
  20. request-issue-framing-improvement:
  21. runs-on: ubuntu-latest
  22. if: |
  23. contains(github.event.comment.body,'/improve') && (
  24. github.event.comment.author_association == 'OWNER' ||
  25. github.event.comment.author_association == 'COLLABORATOR' ||
  26. github.event.comment.author_association == 'CONTRIBUTOR' )
  27. steps:
  28. - name: request-issue-framing-improvement
  29. run: |
  30. curl \
  31. -X POST \
  32. -H "Accept: application/vnd.github+json" \
  33. -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
  34. https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
  35. -d '{"body":"This issue is put on hold due to low quality. No reviews or fixes will be performed at this time. Eventually, it will be closed. While we appreciate your effort writing, we are not able to further investigate it. Please improve it by writing a better title or providing more details, and you may re-open it."}'
  36. add-label-duplicate:
  37. runs-on: ubuntu-latest
  38. if: |
  39. contains(github.event.comment.body, '/duplicate') && (
  40. github.event.comment.author_association == 'OWNER' ||
  41. github.event.comment.author_association == 'COLLABORATOR' ||
  42. github.event.comment.author_association != 'CONTRIBUTOR' )
  43. steps:
  44. - name: add-label-duplicate
  45. run: |
  46. curl \
  47. -X POST \
  48. -H "Accept: application/vnd.github+json" \
  49. -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
  50. https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels \
  51. -d '{"labels":["duplicate"]}'