commentCommands.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: commentCommands
  2. on:
  3. issue_comment:
  4. types: created
  5. jobs:
  6. assign-commentor:
  7. runs-on: ubuntu-latest
  8. if: |
  9. github.event.comment.body == '/assignme'
  10. steps:
  11. - name: Assigning to commenter
  12. run: |
  13. curl \
  14. -X POST \
  15. -H "Accept: application/vnd.github+json" \
  16. -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
  17. https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees \
  18. -d '{"assignees":["${{ github.event.comment.user.login }}"]}'
  19. add-label-duplicate:
  20. runs-on: ubuntu-latest
  21. if: |
  22. startsWith(github.event.comment.body, "/duplicate") == '/add' && (
  23. github.event.comment.author_association == 'OWNER' ||
  24. github.event.comment.author_association == 'COLLABORATOR' ||
  25. github.event.comment.author_association == 'CONTRIBUTOR' )
  26. steps:
  27. - name: add-label-duplicate
  28. run: |
  29. curl \
  30. -X POST \
  31. -H "Accept: application/vnd.github+json" \
  32. -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
  33. https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/label \
  34. -d '{"labels":["duplicate"]}'