{% macro repo_url(summary) -%} {%- if summary.team_slug -%} /teams/{{ summary.team_slug }}/{{ summary.repo_slug }} {%- elif summary.owner_username -%} /{{ summary.owner_username }}/{{ summary.repo_slug }} {%- elif summary.actor_username and summary.repo_slug -%} /{{ summary.actor_username }}/{{ summary.repo_slug }} {%- endif -%} {%- endmacro %} {% macro repo_label(summary) -%} {%- if summary.team_slug -%} {{ summary.team_slug }}/{{ summary.repo_slug }} {%- elif summary.owner_username -%} {{ summary.owner_username }}/{{ summary.repo_slug }} {%- elif summary.actor_username and summary.repo_slug -%} {{ summary.actor_username }}/{{ summary.repo_slug }} {%- elif summary.repo_slug -%} {{ summary.repo_slug }} {%- endif -%} {%- endmacro %} {% macro source_repo_url(summary) -%} {%- if summary.source_team_slug -%} /teams/{{ summary.source_team_slug }}/{{ summary.source_repo_slug }} {%- elif summary.source_owner_username -%} /{{ summary.source_owner_username }}/{{ summary.source_repo_slug }} {%- endif -%} {%- endmacro %} {% macro source_repo_label(summary) -%} {%- if summary.source_team_slug -%} {{ summary.source_team_slug }}/{{ summary.source_repo_slug }} {%- elif summary.source_owner_username -%} {{ summary.source_owner_username }}/{{ summary.source_repo_slug }} {%- elif summary.source_repo_slug -%} {{ summary.source_repo_slug }} {%- endif -%} {%- endmacro %} {% macro fork_repo_url(summary) -%} {%- if summary.fork_team_slug -%} /teams/{{ summary.fork_team_slug }}/{{ summary.fork_repo_slug }} {%- elif summary.fork_owner_username -%} /{{ summary.fork_owner_username }}/{{ summary.fork_repo_slug }} {%- endif -%} {%- endmacro %} {% macro fork_repo_label(summary) -%} {%- if summary.fork_team_slug -%} {{ summary.fork_team_slug }}/{{ summary.fork_repo_slug }} {%- elif summary.fork_owner_username -%} {{ summary.fork_owner_username }}/{{ summary.fork_repo_slug }} {%- elif summary.fork_repo_slug -%} {{ summary.fork_repo_slug }} {%- endif -%} {%- endmacro %} {% macro thread_url(summary) -%} {%- set repo_href = repo_url(summary) -%} {%- if repo_href and summary.thread_number -%} {{ repo_href }}/threads/{{ summary.thread_number }} {%- endif -%} {%- endmacro %} {% macro reply_url(summary) -%} {%- set thread_href = thread_url(summary) -%} {%- if thread_href and summary.reply_number -%} {{ thread_href }}?reply_root={{ summary.reply_number }} {%- endif -%} {%- endmacro %} {% macro pull_url(summary) -%} {%- set repo_href = repo_url(summary) -%} {%- if repo_href and summary.pull_number -%} {{ repo_href }}/pulls/{{ summary.pull_number }} {%- endif -%} {%- endmacro %} {% macro branch_name(summary) -%} {%- if summary.ref_name -%} {{ summary.ref_name | replace("refs/heads/", "") }} {%- endif -%} {%- endmacro %} {% macro branch_url(summary) -%} {%- set repo_href = repo_url(summary) -%} {%- set branch = branch_name(summary) -%} {%- if repo_href and branch -%} {{ repo_href }}/branches/{{ branch }} {%- endif -%} {%- endmacro %} {% macro tag_name(summary) -%} {%- if summary.ref_name -%} {{ summary.ref_name | replace("refs/tags/", "") }} {%- endif -%} {%- endmacro %} {% macro tag_url(summary) -%} {%- set repo_href = repo_url(summary) -%} {%- set tag = tag_name(summary) -%} {%- if repo_href and tag -%} {{ repo_href }}/tag/{{ tag }} {%- endif -%} {%- endmacro %} {% macro commit_url(summary) -%} {%- set repo_href = repo_url(summary) -%} {%- if repo_href and summary.merge_commit_oid -%} {{ repo_href }}/commit/{{ summary.merge_commit_oid }} {%- endif -%} {%- endmacro %}