Skip to content

Commit 514e2e9

Browse files
fix: remove automated contribution message
Unfortunately, the automated contribution message does not work properly. To evaluate this correctly, we need to first filter out all merge commits. To do this, we need to check the length of the `parents` property. I did not find a way to do this with jinja2 filters. Which would allow us to do something like `rejectattr`. In the code snippet removed in this PR, I attempted to create a property to filter the merge commits on. This also doesn't work because the underlying object exposed by mergify is not a dictionary but a class and thus does not have the `update` function. Mergify is shipping an additional property next month: Mergifyio/mergify#4636 (reply in thread). Thus, I am replacing this automated mechanism with a manual section that we can add to the PR until mergify ships the additional property that we can utilize to implement this in a clean way. Related: #4130. Related: #4104. Pull-Request: #4131.
1 parent 7953a79 commit 514e2e9

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

.github/mergify.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,8 @@ defaults:
88
{{ body | get_section("## Description", "") }}
99
1010
Pull-Request: #{{ number }}.
11-
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
12-
{%- set _ = 0 -%}
13-
{%- for commit in commits -%}
14-
{%- if commit.parents|length != 1 -%}
15-
{%- set _ = commit.update({'merge': true}) -%}
16-
{%- else -%}
17-
{%- set _ = commit.update({'merge': false}) -%}
18-
{%- endif -%}
19-
{%- endfor -%}
20-
{%- for commit in (commits | rejectattr("merge") | unique(False, 'email_author')) | rejectattr("author", "==", author) -%}
21-
Co-authored-by: {{ commit.author }} <{{ commit.email_author }}>
22-
{% endfor %}
23-
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
11+
12+
{{ body | get_section("## Attributions", "") }}
2413
2514
pull_request_rules:
2615
- name: Ask to resolve conflict

0 commit comments

Comments
 (0)