Skip to content
New issue

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

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

Already on GitHub? # to your account

Show list of contributors in the changelog #805

Open
wcandillon opened this issue Apr 2, 2024 · 8 comments
Open

Show list of contributors in the changelog #805

wcandillon opened this issue Apr 2, 2024 · 8 comments

Comments

@wcandillon
Copy link

Can you use the plugin options to customize the output. I would like the changelog to display the list of contributors like on this example release: https://github.com/Shopify/react-native-skia/releases/tag/v1.0.2

Thank you in advance for your guidance there.

@babblebey
Copy link
Member

babblebey commented Jul 31, 2024

Hi @wcandillon,

Of-course you can customize this using lodash templates leveraging the exposure to the semantic-release result context object within where you can access things like the context.commits array which holds data of contributors. See https://semantic-release.gitbook.io/semantic-release/developer-guide/js-api#result for full list of result context object.

You can attempt replicating the format in your stated example release with the lodash template and setting it as the releaseBodyTemplate value in your plugin config accordingly.

Do let me know if you need some clarity or more info on this 😉

@jo-gross
Copy link

I was wondering if somebody already build a working template?
@wcandillon how did you solved it?

@babblebey
Copy link
Member

babblebey commented Feb 10, 2025

I have attempted to do this but there's some limitations.... Hence a good workaround is a plugin that fetches a list of contributors, since we haven't seen enough requests to make this available in the plugin's core.

I plan on writing this plugin but you can take a dig at it if you'd like to, here's the idea...

  • There's 2 steps above the "generateReleaseNote" step in the release lifecycle i.e. prepare and analyzeCommits
  • Write the plugin to fetch the contributors (which will be commit authors on github) in one of these steps using the commit hash (you can access that from context.commit) via GitHub Rest/GraphQL API
  • Write the response into a new object that can be saved back into the context object say context.pluginData.contributors

This object can then be consumed in the generate release note config with lodash template.

@jo-gross
Copy link

Thanks for your response. That sounds understandable. I tried a few things, but I couldn't get my plugin to work correctly. The code is also quite bad. So, I would appreciate it if you could take a look at it when you have time.

@babblebey
Copy link
Member

Sure, do leave a link to the Repo

@travi
Copy link
Member

travi commented Feb 14, 2025

i would love to have this capability be the default behavior of this plugin. i agree with @babblebey that it would be best to prototype with a community supported solution, but i am supportive of a path toward integrating with this plugin if we can prove it out

@babblebey
Copy link
Member

@jo-gross,

So, I have written a boilerplate (in my term) plugin that fetches the commit authors login from GitHub, how you consume it still relies on how you want that plugin to work...

see jo-gross/semantic-release-notes-with-contributor#2

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

No branches or pull requests

4 participants