Created
September 3, 2020 15:33
-
-
Save RichardLitt/173d94994106a1e869b18c12276f3d99 to your computer and use it in GitHub Desktop.
name-your-contribs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script grabs totals for contributors for the OrbitDB organization for a three month period. | |
# It needes to be edited, but keeping this here for next time should save some life. | |
# This could easily be extended elsewhere. | |
# npm i -g name-your-contributors | |
# You will also need to have [`jq`](https://stedolan.github.io/jq/download/) installed. | |
# brew install jq | |
# Fix these to match the current month | |
# TODO Automate monthly so you don't need to do 'before' and 'after' | |
# GITHUB_TOKEN=FILLMEIN name-your-contributors -o orbitdb -m June --commits > orbitdb-june-contribs.json | |
# Fix these to match the current month | |
name-your-contributors -o orbitdb -m October --commits > orbitdb-oct-contribs.json | |
name-your-contributors -o orbitdb -m November --commits > orbitdb-nov-contribs.json | |
name-your-contributors -o orbitdb -m December --commits > orbitdb-dec-contribs.json | |
# Change these to match the output above | |
cat orbitdb-oct-contribs.json | jq '[ .[][].count]' | jq 'add | "There were \(.) contributions (including commits, comments and PRs) in October."' | |
cat orbitdb-nov-contribs.json | jq '[ .[][].count]' | jq 'add | "There were \(.) contributions (including commits, comments and PRs) in November."' | |
cat orbitdb-dec-contribs.json | jq '[ .[][].count]' | jq 'add | "There were \(.) contributions (including commits, comments and PRs) in December."' | |
# These will just print out the unique numbers. | |
# Change these to match the output above. | |
cat orbitdb-oct-contribs.json | jq '[ .[][].login]' | jq unique | jq -r .[] | wc -l | awk '{print "There were "$1" contributors in October."}' | |
cat orbitdb-nov-contribs.json | jq '[ .[][].login]' | jq unique | jq -r .[] | wc -l | awk '{print "There were "$1" contributors in November."}' | |
cat orbitdb-dec-contribs.json | jq '[ .[][].login]' | jq unique | jq -r .[] | wc -l | awk '{print "There were "$1" contributors in December."}'% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment