github.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. title: |
  2. {{- if and .starred_at (eq .action "created")}}
  3. ⭐ {{ .sender.login }} starred {{ .repository.name }}
  4. {{- else if and .repository (eq .action "started")}}
  5. 👀 {{ .sender.login }} started watching {{ .repository.name }}
  6. {{- else if and .comment (eq .action "created") }}
  7. 💬 New comment on issue #{{ .issue.number }} {{ .issue.title }}
  8. {{- else if .pull_request }}
  9. 🔀 Pull request {{ .action }}: #{{ .pull_request.number }} {{ .pull_request.title }}
  10. {{- else if .issue }}
  11. 🐛 Issue {{ .action }}: #{{ .issue.number }} {{ .issue.title }}
  12. {{- else }}
  13. {{ fail "Unsupported GitHub event type or action." }}
  14. {{- end }}
  15. message: |
  16. {{ if and .starred_at (eq .action "created")}}
  17. Stargazer: {{ .sender.html_url }}
  18. Repository: {{ .repository.html_url }}
  19. {{- else if and .repository (eq .action "started")}}
  20. Watcher: {{ .sender.html_url }}
  21. Repository: {{ .repository.html_url }}
  22. {{- else if and .comment (eq .action "created") }}
  23. Commenter: {{ .comment.user.html_url }}
  24. Repository: {{ .repository.html_url }}
  25. Comment link: {{ .comment.html_url }}
  26. {{ if .comment.body }}
  27. Comment:
  28. {{ .comment.body | trunc 2000 }}{{ end }}
  29. {{- else if .pull_request }}
  30. Branch: {{ .pull_request.head.ref }} → {{ .pull_request.base.ref }}
  31. {{ .action | title }} by: {{ .pull_request.user.html_url }}
  32. Repository: {{ .repository.html_url }}
  33. Pull request: {{ .pull_request.html_url }}
  34. {{ if .pull_request.body }}
  35. Description:
  36. {{ .pull_request.body | trunc 2000 }}{{ end }}
  37. {{- else if .issue }}
  38. {{ .action | title }} by: {{ .issue.user.html_url }}
  39. Repository: {{ .repository.html_url }}
  40. Issue link: {{ .issue.html_url }}
  41. {{ if .issue.labels }}Labels: {{ range .issue.labels }}{{ .name }} {{ end }}{{ end }}
  42. {{ if .issue.body }}
  43. Description:
  44. {{ .issue.body | trunc 2000 }}{{ end }}
  45. {{- else }}
  46. {{ fail "Unsupported GitHub event type or action." }}
  47. {{- end }}