mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-03 05:01:24 +00:00
fix(ci): improve attribution of co-authors
Fix the `Co-authored-by` inclusion in commit messages so that co-authorship is properly expressed. Additionally, filter merge commits before unique authors. Previously, we would not attribute an author if their first commit in a PR was a merge commit. Finally, we remove superfluous newlines between the `Co-authored-by` lines. Pull-Request: #4104. Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
parent
5c362fcab1
commit
41076f6acd
16
.github/mergify.yml
vendored
16
.github/mergify.yml
vendored
@ -4,15 +4,19 @@ defaults:
|
|||||||
method: squash
|
method: squash
|
||||||
commit_message_template: |
|
commit_message_template: |
|
||||||
{{ title }}
|
{{ title }}
|
||||||
|
|
||||||
{{ body | get_section("## Description", "") }}
|
{{ body | get_section("## Description", "") }}
|
||||||
|
|
||||||
Pull-Request: #{{ number }}.
|
Pull-Request: #{{ number }}.
|
||||||
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
|
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
|
||||||
{% for commit in (commits | unique(False, 'email_author')) | rejectattr("author", "==", author) %}
|
{%- set _ = 0 -%}
|
||||||
{% if commit.parents|length == 1 %}
|
{%- for commit in commits -%}
|
||||||
Co-Authored-By: {{ commit.author }} <{{ commit.email_author }}>
|
{%- if commit.parents|length != 1 -%}
|
||||||
{% endif %}
|
{%- set _ = commit.update({'merge': true}) -%}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- for commit in (commits | rejectattr("merge") | unique(False, 'email_author')) | rejectattr("author", "==", author) -%}
|
||||||
|
Co-authored-by: {{ commit.author }} <{{ commit.email_author }}>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
|
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user