Skip to content

Commit

Permalink
update gitlab template
Browse files Browse the repository at this point in the history
  • Loading branch information
HarHarLinks committed Dec 28, 2021
1 parent fd83e7d commit 8a8f10e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/gitlab.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
commits:<br>
<ul>
{% for c in commits %}
<li>{{ c.author.name }}: {{ c.title }}</li>
<li><a href="{{ repository.homepage }}/-/commit/{{ c.id }}"><code>{{ c.id[:7] }}</code></a> {{ c.author.name }}: {{ c.title }}</li>
{% endfor %}
</ul>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion examples/gitlab.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"url": "https://matrix.example.org/appservice-webhooks/api/v1/matrix/hook/",
"displayName": "GitLab",
"avatar": "https://i.gyazo.com/thumb/1000/566debcae9702858a0ae487543e58123-png.png",
"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 %}",
"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 %}",
"defaultFormat": "html",
"defaultEmoji": false,
"defaultMsgtype": "{% if build_status is defined and build_status == 'failed' %}plain{% else %}notice{% endif %}"
Expand Down

0 comments on commit 8a8f10e

Please sign in to comment.