BobAnkh / add-contributors

A Github Action to add contributors to your file automatically. Feel free to contribute!
https://github.com/marketplace/actions/auto-add-contributors
Apache License 2.0
33 stars 20 forks source link

[enhancement] Exclude certain accounts from being listed in the contributors. #46

Closed mmattbtw closed 3 years ago

mmattbtw commented 3 years ago

Is your feature request related to a problem? Please describe

Yes, some bot accounts (like @renovate-bot and @codacy-badger) show up in the contributors.

Description of the new feature/enhancement

Add a parameter so you can pass in a list of users to ignore.

Proposed technical implementation details (optional)

https://github.com/BobAnkh/add-contributors/blob/00b1222651ba056f977cf3ae40972812fdec4bbf/main.py#L81 After this line, you could simply just do

if contributor['name'] not in IGNORED_CONTRIBUTORS:
boring-cyborg[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

gitmagic-app[bot] commented 3 years ago

Everything looks good :thumbsup:

BobAnkh commented 3 years ago

Really a good feature.

I will do this in the next release.@mmattbtw

BobAnkh commented 3 years ago

@mmattbtw Hi, I have added this feature in v0.2.0, you can try and test if this feature works as expected.

Again thank you for proposing this new feature.

mmattbtw commented 3 years ago

@BobAnkh didn't work for me on my repo, but I think #47 will fix it

BobAnkh commented 3 years ago

@mmattbtw I will see how you fix it in #47, to see if I can do this work.

BobAnkh commented 3 years ago

@mmattbtw Is this probably because that you specify an incorrect name for those accounts? I add debug log in the recent commits so that it will print all the contributors' names in the log.

e.g. @codacy-badger has the name Codacy Badger, and @renovate-bot has the name WhiteSource Renovate

Could you please see if you specify the correct name of those accounts?

BobAnkh commented 3 years ago

@mmattbtw Is this probably because that you specify an incorrect name for those accounts? I add debug log in the recent commits so that it will print all the contributors' names in the log.

Could you please see if you specify the correct name of those accounts?

This log will be like that:

image

mmattbtw commented 3 years ago

Wait, are you supposed to add the display name? or the username

BobAnkh commented 3 years ago

Well here we use display name, for we are showing it in the contributors' list 🤣

BobAnkh commented 3 years ago

It seems that Github doesn't provide a good api to extract username? This is why I only support display name.

If you have a better idea on this issue, please tell me~

mmattbtw commented 3 years ago

Ah ok, I would just make sure you say something in the README.md that IGNORED_CONTRIBUTORS take display names and not usernames, other then that it looks good to me :]

BobAnkh commented 3 years ago

Ah ok, I would just make sure you say something in the README.md that IGNORED_CONTRIBUTORS take display names and not usernames, other then that it looks good to me :]

@mmattbtw I update the readme file with a new NOTE.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.