Releasing github_contributions Ruby Gem

Screenshot (using Carbon) showing the CLI of github_contributions.

This post is more of an announcement of my new Ruby gem github_contributions. It is a tool that I’ve been using to track my GitHub contributions. I’ve put the contents of the README.md from the repository here as it does a good job describing the tool.

GitHub Contributions

Ever wanted to know where you (or someone else) are making contributions on GitHub?

Your GitHub profile shows you the Contributions Calendar and Contribution activity, which both provide great visualizations and details covering contributions of the following:

  • creating/closing issues
  • creating/closing/merging/reviewing pull requests
  • creating repositories
  • authoring commits on the main branch of repositories
  • starting/answering discussions

I personally wanted to track comments on issues and pull requests as I felt they were a good indication of contributions. It sometimes isn’t uncommon for a lot of discussions to happen on issues or even a pull request.

I am a fan of Obsidian right now to track my day at work. Recording these contributions in GitHub makes it simple to recall what I did in previous days/weeks. This is even more important if you have a BragDoc. As Obsidian uses Markdown, that is the primary format that this tool is built for.

Install

gem install github_contributions

You need a GitHub Personal Access Token in your ENVs as GITHUB_ACCESS_TOKEN for this gem to work.

Usage

# Show me contributions for 'kevinjalbert' for today
github_contributions -a "kevinjalbert"

# Show me contributions for 'kevinjalbert' for today only in the 'shopify' org
github_contributions -a "kevinjalbert" -o "shopify"

# Show me contributions for 'kevinjalbert' in the last week
github_contributions -a "kevinjalbert" -s "last week"

# Show me contributions for 'kevinjalbert' for the week before last
github_contributions -a "kevinjalbert" -s "two weeks ago" -e "one week ago"

# Show me contributions for 'kevinjalbert' for only yesterday
github_contributions -a "kevinjalbert" -s "yesterday" -e "yesterday"

# Help
github_contributions -h

Contributions are grouped by their pull request or issue in order of creation time. This ends up producing a rather detailed list of where contributions were made in the specified time frame. Links are present to easily allow you to jump directly to the contribution. Everything is displayed in Markdown, ready to be copy/pasted where desired. The following is an example of what the output looks like: