Skip to content

[Feature request] Expose Co-Authored-By Metadata in Commit API #2181

Description

@yeikel

Use Case:

Identify all contributors to a commit, including those listed as Co-Authored-By in the commit message footer. Currently, the API exposes only the main author and committer, but not co-authors.

                    var userEmail = commit.getAuthor().getEmail();
                    var commiterEmail = commit.getCommitter().getEmail();
                    // How to get the co-author with this API? 

Proposed Solution:

  • Add a method to GHCommit (or similar) that returns a list of co-authors parsed from the commit message.
  • Optionally, provide a structured representation (e.g., name and email) for each co-author.

Example API:

List<GHUser> getCoAuthors();

References:

https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line

Note to maintainers:

Apologies if this is currently possible, please share any snippet if you can. Thank you in advance!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions