-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub.jinja2
39 lines (39 loc) · 3.33 KB
/
github.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% if pusher is defined or release is defined or discussion is defined or issue is defined or hook is defined or zen is defined or pull_request is defined %}
[<strong><a href="{{ repository.html_url }}">{{ repository.full_name }}</a></strong>]<br>
## event is a push
{% if pusher is defined %}
{% if sender.login == pusher.name %}<a href="{{ sender.html_url }}">{{ sender.login }}</a>{% else %}{{ pusher.name }}{% endif %}{% if forced %} force{% endif %} pushed <code>{{ after[:7] }}</code> to {% if 'refs/heads/' in ref %}branch <a href="{{ repository.html_url }}/tree/{{ ref|replace('refs/heads/', '') }}"><strong>{{ ref|replace('refs/heads/', '') }}</strong></a>{% else %}{{ ref }}{% endif %}:<br>
<ul>
{% for c in commits %}
<li>{{ c.author.name }}: <a href="{{ c.url }}">{{ c.message }}</a></li>
{% endfor %}
</ul>
## event is a release
{% elif release is defined %}
{% if sender.id == release.author.id %}<a href="{{ sender.html_url }}">{{ sender.login }}</a>{% else %}{{ release.author.name }}{% endif %} <strong>{{ action }} <a href="{{ release.html_url }}">{{ release.tag_name }}</a></strong>{% if prerelease %} (prerelease){% endif %} based on {{ release.target_commitish }}<br>
## event is a discussion
{% elif discussion is defined %}
<a href="{{ discussion.user.html_url }}">{{ discussion.user.login }}</a> {{ action }} <strong>discussion </strong><a href="{{ discussion.html_url }}"><strong>#{{ discussion.number }}</strong> {{ discussion.title }}</a> [{{ state }}]{% if discussion.answer_html_url %} (<a href="{{ discussion.answer_html_url }}">go to answer</a>){% endif %}<br>
## event is an issue or issue_comment
{% elif issue is defined %}
{% if comment is defined %}<a href="{{ comment.user.html_url }}">{{ comment.user.login }}</a>{% else %}<a href="{{ issue.user.html_url }}">{{ issue.user.login }}</a>{% endif %} {{action}}{% if action in ['assigned', 'unassigned'] %} <a href="{{ issue.assignee.html_url }}">{{ issue.assignee.login }}</a> to{% elif comment is defined %} a <a href="{{ comment.html_url }}">comment</a> on {% endif %} <strong>issue </strong><a href="{{ issue.html_url }}"><strong>#{{ issue.number }}</strong> {{ issue.title }} [{{ issue.state }}]</a>{% if action in ['labeled', 'unlabeled'] %} <font color="#{{ issue.label.color }}">{{ issue.label.name }}</font>{% endif %}<br>
## event is meta
{% elif hook is defined %}
{% if action == 'deleted' %}
<a href="{{ sender.html_url }}">{{ sender.login }}</a> {{ action }} webhook "{{ hook.name }}"<br>
{% elif zen is defined %}
<a href="{{ sender.html_url }}">{{ sender.login }}</a> created webhook "{{ hook.name }}"<br>
{{ zen }}<br>
## event is pull_request, pull_request_review, pull_request_review_comment, pull_request_review_thread
{% elif pull_request is defined %}
{% if review is defined %}
<a href="{{ review.user.html_url }}">{{ review.user.login }}</a> {{ action }} a <href="{{ review.html_url }}">review</a> of
{% elif comment is defined %}
<a href="{{ comment.user.html_url }}">{{ comment.user.login }}</a> {{ action }} a <href="{{ comment.html_url }}">comment to a review</a> of
{% else %}
<a href="{{ pull_request.user.html_url }}">{{ pull_request.user.login }}</a> {{ action }} {% if merged is sameas true %}(merged) {% endif %}
{% endif %}
<strong><a href="{{ pull_request.html_url }}">PR #{{ pull_request.number }}</a> {{ pull_request.title }} [{{ pull_request.state }}]<br>
{% endif %}
{% endif %}
{% endif %}