Open Sauced guides new contributors. Our approach towards onboarding offers a way to track contributions through the GraphQL powered dashboard.
My recent open source contribution happened while live streaming on twitch. Occasionally, at the end of a stream, I leverage the new GitHub CLI to list the project contributors and noticed the CLI does not filter out contributions from bots.
The top maintainers on my project are dependabot-preview[bot] and gh-action[bot], and as much as I appreciate their work, I would prefer the bots not listed in the "thank you credits."
With this problem, I had enough interest to make my first contribution.
Before writing any code, I forked the repo to start researching a fix for this issue. I almost jumped right in with a fix after learning wherein the project to add this filter, but I opted to open an issue with my proposed solution as a way to wait for a response from the maintainers.
The CONTRIBUTING.md requests that contributors open issues before making any contributions.
My issue explanation included my desire to run the
gh credits command with the option to filter for humans-only. You can read that issue below.
Describe the feature or problem you’d like to solve
The top maintainers on my project are dependabot-preview[bot] and gh-action[bot]. I am opening this issue pre-emptively
I would like to run the
gh credits command in contributor meetings, but with the option to filter for humans-only. TBH, I would like to make the human-only filter the default and make showing bots the option.
How will it benefit CLI and its users?
I don't think having dependabot being the number 1 contributor in the list is useful to me or others and highlighting humans-only by default is preferred for now, or at least until the bots take over.
example of the option in use
gh credits open-sauced/open-sauced --bots
running the credits without a flag should return only humans.
gh credits open-sauced/open-sauced
I am new to cobra and a novice at Go, but this is the flag
cmd.Flags().BoolVarP(&opts.Bots, "bots", "bts", false, "Include bots in the credits")
Is this needed?
I am aware I can get human-only names using grep, but unable to do that and get the cool animation
gh credits open-sauced/open-sauced | grep -v '\[bot\] $'
screenshots of what my output looks like today (includes bots).
As an eager contributor, it is easy to miss this step announcing your interest in contributing. I have made what I thought were contributions to projects before, only to find out that the project was going a different direction and the code I committed was to a section marked for future deletion.
My wait lasted for a few hours for the first response and another few days for a :thumbs-up: to start working on my solution. The maintainers were friendly and offered suggestions and border solutions themselves. We concluded my answer was close but could be simplified, which was another reason why opening the issue first is the preferred first contribution.
You can view my merged solution below.
What is this?
The top maintainers on my project are dependabot-preview[bot] and gh-action[bot]. I am opening this PR in response to https://github.com/cli/cli/issues/1597.
I added another condition to leave out logins that are not humans (Users).
I ran the test in a Codespace and they passed, let me know if a new test is needed for this condition.
I dedicate my Friday Twitch streams to open source work and invite you to join that and our pre-stream-amas, where we chat through our ideas for open source contributions.
Watch me the full video on the Open Sauced YouTube channel.
Posted on by: