Skip to content

Instantly share code, notes, and snippets.

@pbsds
Forked from lorenzleutgeb/committer-progress.sh
Last active October 12, 2025 20:49
Show Gist options
  • Select an option

  • Save pbsds/7af827a53c103cd3d40902f9b0b21843 to your computer and use it in GitHub Desktop.

Select an option

Save pbsds/7af827a53c103cd3d40902f9b0b21843 to your computer and use it in GitHub Desktop.
Nixpkgs Committer Progress
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash gh
set -eu
# See <https://gist.github.com/lorenzleutgeb/239214f1d60b1cf8c79e7b0dc0483deb>.
# Will exit non-zero if not authenticated.
gh auth status
if [ $# -ge 1 ]
then
# Pass GitHub username as commandline argument.
LOGIN=$1
else
# Default to currently logged in user.
LOGIN=$(gh api user --jq .login)
fi
BASE="gh pr list --repo NixOS/nixpkgs --json id --jq length --limit 2000"
MERGED=$($BASE --author "$LOGIN" --state merged)
REVIEWED=$($BASE --search "reviewed-by:$LOGIN -author:$LOGIN" --state all)
COMMENTED=$($BASE --search "commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN" --state all)
INVOLVED=$($BASE --search "involves:$LOGIN -commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN" --state all)
REVIEWED_SANS_BOT=$($BASE --search "reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
COMMENTED_SANS_BOT=$($BASE --search "commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
INVOLVED_SANS_BOT=$($BASE --search "involves:$LOGIN -commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
cat << EOM
――――――――――
- [$MERGED PRs merged](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+is%3Amerged+author%3A$LOGIN)
- [$REVIEWED PRs reviewed](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$COMMENTED PRs otherwise commented](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$INVOLVED PRs otherwise involved](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+involves%3A$LOGIN+-commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$REVIEWED_SANS_BOT PRs reviewed](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
- [$COMMENTED_SANS_BOT PRs otherwise commented](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
- [$INVOLVED_SANS_BOT PRs otherwise involved](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+involves%3A$LOGIN+-commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
EOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment