Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add author.login to context.commit for Improved Commit Author Identification #905

Open
babblebey opened this issue Aug 23, 2024 · 1 comment

Comments

@babblebey
Copy link
Member

Currently, the context.commit object in the semantic-release/github plugin includes the author object with the following properties:

  • author.name: The name of the commit author.
  • author.email: The email of the commit author.
  • author.short: The date of the commit.

While these details are useful, adding the author.login property would be beneficial. The author.login would provide the GitHub/GitLab username of the commit author, allowing for easier association of commits with users in the open-source community.

Use Case:

One practical application of the author.login property is in generating release notes. For example, a releaseBodyTemplate could utilize the author.login to include a more personalized and identifiable reference to contributors as requested in #805. Here’s a sample config value demo'ing usage...

const releaseBodyTemplate =  `
## Contributors
<% _.forEach(commits, function(commit) { %>
  <img src="https://github.com/<%- commit.author.login %>.png" alt="<%- commit.author.login %>" width="50">
<% }) %>
`;

This addition would enhance the visibility of contributors in release notes and improve the overall attribution process.

Request:

Please consider adding the author.login property to the author object within the context.commit. This enhancement will facilitate better integration with user identities on GitHub/GitLab and improve the generation of release notes and other related tasks.

@babblebey
Copy link
Member Author

Following a conversation with @gr2m about this, we resolved that....

  • Feature would be nice to have for sure ✅
  • But, How many people needs this feature though? 🤔 --- Ummm I do ✋
  • The Limitation of this is that we are getting the context.commit items from the local git instance of a project within where there isn't access to a user's username/login, email and name are safer options as author id for commits in this context; hence.....
  • Getting/providing access to commit author username/login would require new computation for the author within the respective github/gitlab/other platform plugin; but it is important to state that....
  • The context.commit property should never be altered within any plugin, i.e. when the commit author username/login has been fetched, we should not attempt adding the property author.login to the object.... As this might lead to some side effects.... We can instead create an entirely new object that can be available within the context of the respective plugin where this additional data was fetched for consumption instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant