Skip to content

Commit 8a8f10e

Browse files
committed
update gitlab template
1 parent fd83e7d commit 8a8f10e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/gitlab.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
commits:<br>
77
<ul>
88
{% for c in commits %}
9-
<li>{{ c.author.name }}: {{ c.title }}</li>
9+
<li><a href="{{ repository.homepage }}/-/commit/{{ c.id }}"><code>{{ c.id[:7] }}</code></a> {{ c.author.name }}: {{ c.title }}</li>
1010
{% endfor %}
1111
</ul>
1212
{% endif %}

examples/gitlab.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"url": "https://matrix.example.org/appservice-webhooks/api/v1/matrix/hook/",
44
"displayName": "GitLab",
55
"avatar": "https://i.gyazo.com/thumb/1000/566debcae9702858a0ae487543e58123-png.png",
6-
"template": "{% if object_kind in ['push', 'build'] %}{% if event_name is defined and event_name == 'push' %}[<strong><a href=\"{{ repository.homepage }}\">{{ project.path_with_namespace }}</a></strong>]<br>{{ user_name }} pushed <code>{{ checkout_sha[:7] }}</code> to {% if 'refs/heads/' in ref %}branch <a href=\"{{ repository.homepage }}/-/tree/{{ ref|replace('refs/heads/', '') }}\"><strong>{{ ref|replace('refs/heads/', '') }}</strong></a>{% else %}{{ ref }}{% endif %}<br>{% if commits %}commits:<br><ul>{% for c in commits %}<li>{{ c.author.name }}: {{ c.title }}</li>{% endfor %}</ul>{% endif %}{% elif object_kind == 'build' %}[<strong><a href=\"{{ repository.homepage }}\">{{ project_name }}</a></strong>]<br>CI build <font color=\"{% if build_status == 'success' %}#00ff00{% elif build_status == 'failed' %}red{% else %}white{% endif %}\">{{ build_status }}</font> <strong><a href=\"{{ repository.homepage }}/-/jobs/{{ build_id }}\">#{{ build_id }}</a></strong><br>ref <em>{{ ref }}</em> (HEAD commit <code>{{ commit.sha[:7] }}</code> \"<em>{{ commit.message|trim }}</em>\")<br>using configuration <em>{{ build_name }}</em>{% if runner %} on runner <em>{{ runner.description }}</em>{% endif %}<br>{% endif %}{% endif %}",
6+
"template": "{% if object_kind in ['push', 'build'] %}{% if event_name is defined and event_name == 'push' %}[<strong><a href=\"{{ repository.homepage }}\">{{ project.path_with_namespace }}</a></strong>]<br>{{ user_name }} pushed <code>{{ checkout_sha[:7] }}</code> to {% if 'refs/heads/' in ref %}branch <a href=\"{{ repository.homepage }}/-/tree/{{ ref|replace('refs/heads/', '') }}\"><strong>{{ ref|replace('refs/heads/', '') }}</strong></a>{% else %}{{ ref }}{% endif %}<br>{% if commits %}commits:<br><ul>{% for c in commits %}<li><a href=\"{{ repository.homepage }}/-/commit/{{ c.id }}\"><code>{{ c.id[:7] }}</code></a> {{ c.author.name }}: {{ c.title }}</li>{% endfor %}</ul>{% endif %}{% elif object_kind == 'build' %}[<strong><a href=\"{{ repository.homepage }}\">{{ project_name }}</a></strong>]<br>CI build <font color=\"{% if build_status == 'success' %}#00ff00{% elif build_status == 'failed' %}red{% else %}white{% endif %}\">{{ build_status }}</font> <strong><a href=\"{{ repository.homepage }}/-/jobs/{{ build_id }}\">#{{ build_id }}</a></strong><br>ref <em>{{ ref }}</em> (HEAD commit <code>{{ commit.sha[:7] }}</code> \"<em>{{ commit.message|trim }}</em>\")<br>using configuration <em>{{ build_name }}</em>{% if runner %} on runner <em>{{ runner.description }}</em>{% endif %}<br>{% endif %}{% endif %}",
77
"defaultFormat": "html",
88
"defaultEmoji": false,
99
"defaultMsgtype": "{% if build_status is defined and build_status == 'failed' %}plain{% else %}notice{% endif %}"

0 commit comments

Comments
 (0)