Skip to content

Commit

Permalink
🚚 Add co-author information at the end of commit messages (#5852)
Browse files Browse the repository at this point in the history
This PR adds co-author information at the end the mergify commit messages. GitHub parses lines containing `Co-Authored-By` at the end of the commit message and adds them as co-authors.

This should solve weblate getting all the recognition from translations and actual translators to co-author their translation PRs.

I've tried this in a forked repo but I wasn't able to test an actual co-author so probably we'll need some trial and error testing.
  • Loading branch information
jotare authored Oct 16, 2024
1 parent 8ef5162 commit c65e449
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ queue_rules:
commit_message_template: |-
{{ title }} (#{{number}})
{{ body }}
{# Add co-author information at the end of the squash merge commit message #}
{% for co_author in co_authors | unique %}
Co-Authored-By: {{ co_author.name }} <{{ co_author.email }}>
{% endfor %}
{# `Co-Authored-By` lines must the be last ones for GitHub to recognize them #}
pull_request_rules:
- name: Automatic squash merge on approval
Expand All @@ -21,4 +26,4 @@ pull_request_rules:
comment:
message: Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
queue:
name: default_queue
name: default_queue

0 comments on commit c65e449

Please sign in to comment.