Last active
July 25, 2025 20:32
-
-
Save psschwei/3c4f3fe100faf4eb8cd077eae436fc5c to your computer and use it in GitHub Desktop.
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
| # To get enterprise activity: | |
| # GH_HOST=github.enterprise.com ./weekly-activity.sh | |
| which gdate > /dev/null && date_cmd="gdate" || date_cmd="date" | |
| starting_date=$($date_cmd -dlast-monday +"%Y-%m-%d") | |
| gh_search_flags="--updated >=$starting_date --json repository,title,url" | |
| prs_cmd="gh search prs --author @me $gh_search_flags" | |
| reviewed_cmd="gh search prs --reviewed-by @me $gh_search_flags" | |
| issues_cmd="gh search issues --involves @me $gh_search_flags" | |
| prs_len=$($prs_cmd | jq 'length') | |
| reviews_len=$($reviewed_cmd -- -author:@me | jq 'length') | |
| issues_len=$($issues_cmd | jq 'length') | |
| echo "${GH_HOST:=github.com} activity since $starting_date" | |
| echo | |
| if [[ $prs_len > 0 ]]; then | |
| echo "PRs ($prs_len)" | |
| $prs_cmd --template '{{ range . }}{{ printf "* [%s] %s: %s\n" .repository.nameWithOwner .title .url }}{{ end }}' | |
| fi | |
| if [[ $reviews_len > 0 ]]; then | |
| echo "Reviews ($reviews_len)" | |
| $reviewed_cmd --template '{{ range . }}{{ printf "* [%s] %s: %s\n" .repository.nameWithOwner .title .url }}{{ end }}' -- -author:@me | |
| fi | |
| if [[ $issues_len > 0 ]]; then | |
| echo "Issues ($issues_len)" | |
| $issues_cmd --template '{{ range . }}{{ printf "* [%s] %s: %s\n" .repository.nameWithOwner .title .url }}{{ end }}' | |
| fi | |
| echo | |
| echo "Totals: PRs($prs_len) Reviews($reviews_len) Issues($issues_len)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For reference for those that find this, you can run it with any of the following commands, which could be added as local alias':
curl -sSL https://ibm.biz/gh-activity | shbash <(curl -sL https://ibm.biz/gh-activity)GH_HOST=github.ibm.com bash <(curl -sL https://ibm.biz/gh-activity)curl -sSL https://ibm.biz/gh-activity | GH_HOST=github.ibm.com sh