Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Created February 1, 2022 14:42
Show Gist options
  • Save JamieMason/733840c06d9ef3c7d7457dbf42ebcd27 to your computer and use it in GitHub Desktop.
Save JamieMason/733840c06d9ef3c7d7457dbf42ebcd27 to your computer and use it in GitHub Desktop.

List All GitHub Pull Request Reviewers for a Repo

Needs jq installed.

#!/bin/bash

for pull_number in {1..500}
do
  USER="YourGitHubUserName"
  ORG="facebook"
  REPO="react"
  AUTH="$USER:$ENV_VAR_WITH_YOUR_GITHUB_PERSONAL_ACCESS_TOKEN"
  curl --silent -u $AUTH "https://api.github.com/repos/$ORG/$REPO/pulls/$pull_number/reviews" | jq -c '{ users: [.[].user.login] | unique }'
done
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment