-
-
Save KyMidd/289d04e2af8728969e4647e17589aaa1 to your computer and use it in GitHub Desktop.
This file contains 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
for PROJECT in $(echo $EHR_RELATED_STASH_PROJECTS); do | |
echo "💥 Working on project $PROJECT" | |
# Find slug of all repos in a project | |
unset PROJECT_REPOS | |
PROJECT_REPOS=$(curl -s --user $STASH_USER:$STASH_PASS https://$STASH_URL/rest/api/1.0/projects/$PROJECT/repos\?limit\=$PR_LIMIT | jq -r '.values[].slug') | |
# Iterate over each repo to find all PRs, read limit from var | |
for REPO in $(echo $PROJECT_REPOS); do | |
echo "Working on repo $REPO" | |
unset AUTHOR_USER_NAMES | |
unset REVIEWER_USER_NAMES | |
AUTHOR_USER_NAMES=$(curl -s --user $STASH_USER:$STASH_PASS https://$STASH_URL/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests\?state\=ALL\&limit\=$USER_LIMIT | jq -r '.values[].author.user.name' | sort | uniq) | |
REVIEWER_USER_NAMES=$(curl -s --user $STASH_USER:$STASH_PASS https://$STASH_URL/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests\?state\=ALL\&limit\=$USER_LIMIT | jq -r '.values[].reviewers[].user.name' | sort | uniq) | |
echo $AUTHOR_USER_NAMES | tr " " "\n" >> users | |
echo $REVIEWER_USER_NAMES | tr " " "\n" >> users | |
done | |
done | |
# Sort, uniq | |
cat users | sort | uniq > users_sorted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment