Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Pull Request

Proposed Changes

Adds support for recognizing Co-authored-by: commit trailers to include co-authors as contributors. This addresses the request to acknowledge users who contribute via pair programming or collaborative commits.

Changes

  • New env var ACKNOWLEDGE_COAUTHORS (default: True) - enables co-author detection out of the box
  • get_coauthors_from_message() - parses Co-authored-by: trailers from commit messages, supporting any email domain
  • get_coauthor_contributors() - iterates commits to aggregate co-author contributions
  • Modified get_contributors() and get_all_contributors() - integrates co-author detection when enabled, with explicit parameter passing (no default values in function signatures)

How it works

The action now scans commit messages by default for Co-authored-by: trailers and extracts co-author identifiers:

  • GitHub noreply emails (e.g., username@users.noreply.github.com) - extracts the username
  • Other email addresses (e.g., john@example.com) - uses the full email address as the identifier

Example commit message:

Feature implementation

Co-authored-by: Alice <alice@users.noreply.github.com>
Co-authored-by: Bob <bob@example.com>

Co-authors are added as contributors with contribution counts reflecting the number of commits they co-authored. This feature is enabled by default to provide out-of-the-box support for collaborative workflows.

The acknowledge_coauthors parameter is always explicitly passed from the environment configuration to avoid confusion about default precedence.

Usage

The feature is enabled by default. To disable it:

- name: Run contributor action
  uses: github/contributors@v1
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    ACKNOWLEDGE_COAUTHORS: "false"

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either bug, documentation, enhancement, infrastructure, maintenance or breaking
Original prompt

This section details on the original issue you should resolve

<issue_title>Commits might be created by multiple authors. GitHub supports Co-authored-by: for this.</issue_title>
<issue_description>Commits might be created by multiple authors. GitHub supports Co-authored-by: for this.

The action should also report users with Co-authored-by.


Sometimes, one can get the user information by crawling the commits of the PR. I did that in https://github.com/koppor/github-contributors-list. Would be nice if this action supported this as well.

Originally posted by @koppor in #371</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 3, 2025 23:01
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for commits by multiple authors feat: add support for Co-authored-by commit trailers Dec 3, 2025
Copilot AI requested a review from zkoppert December 3, 2025 23:05
@zkoppert zkoppert added enhancement New feature or request and removed feature labels Dec 8, 2025
@zkoppert
Copy link
Member

zkoppert commented Dec 8, 2025

@copilot instead of having ACKNOWLEDGE_COAUTHORS default to False, lets change it to defaulting to true. I think that users will want that to work out of the box. Make sure to update that in the code and documentation as well.

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 8, 2025

@copilot instead of having ACKNOWLEDGE_COAUTHORS default to False, lets change it to defaulting to true. I think that users will want that to work out of the box. Make sure to update that in the code ...

Changed default to True in commit 9798816. Updated:

  • env.py: Default parameter changed to True
  • README.md: Default value in table changed to True
  • .env-example: Example value changed to "True"
  • test_env.py: Test assertions updated to expect True

contributors.py Outdated
start_date: str,
end_date: str,
ghe: str,
acknowledge_coauthors: bool = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why set this to false if the configuration file has true by default. Maybe it's better not to have a default here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed default values from both get_contributors() and get_all_contributors() function parameters in commit 4454fe7. The acknowledge_coauthors parameter is now always explicitly passed from the configuration, eliminating the inconsistency.

@zkoppert
Copy link
Member

@copilot instead of only allowing specific email domains for coauthors, please change the code and documentation to allow any email domain to be recognized as a coauthor. For example: right now john@example.com is not counted as a coauthor but id like that functionality changed so it is included.

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 13, 2025

@copilot instead of only allowing specific email domains for coauthors, please change the code and documentation to allow any email domain to be recognized as a coauthor. For example: right now john@e...

Changed in commit 211543e. Now any email domain is recognized as a co-author:

  • GitHub noreply emails (e.g., username@users.noreply.github.com) extract the username
  • Other emails (e.g., john@example.com) use the full email address as the identifier
  • Updated tests and documentation to reflect this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature release

Projects

None yet

2 participants