diff --git a/README.md b/README.md index 427d3f36..94256b7e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ Join the Accord Project Technology Working Group [Slack channel][apslack] to get For code contributions, read our [CONTRIBUTING guide][contributing] and information for [DEVELOPERS][developers]. +Profile pictures of Accord Project Contributors + ## License Accord Project source code files are made available under the [Apache License, Version 2.0][apache]. diff --git a/assets/contributors.png b/assets/contributors.png new file mode 100644 index 00000000..16dcaee7 Binary files /dev/null and b/assets/contributors.png differ diff --git a/scripts/get_contributors.sh b/scripts/get_contributors.sh new file mode 100755 index 00000000..f677d6ff --- /dev/null +++ b/scripts/get_contributors.sh @@ -0,0 +1,28 @@ +#!/bin/bash +USER=$1 +TOKEN=$2 +ORGANIZATION=accordproject + +# Get all public AP repos +REPOS=( $(curl -u ${USER}:${TOKEN} -s https://api.github.com/orgs/${ORGANIZATION}/repos | jq -r '.[] | select (.fork == false) | .name') ) + +# Get contributors for each repo +CONTRIBUTORS=() +for repo in "${REPOS[@]}"; do + echo "${repo}" + REPO_CONTRIBUTORS=( $(curl -u ${USER}:${TOKEN} -s https://api.github.com/repos/${ORGANIZATION}/${repo}/stats/contributors | jq -r '.[] | .author.id') ) + + # Concatenate the existing contributors with the new ones + CONTRIBUTORS=("${CONTRIBUTORS[@]}" "${REPO_CONTRIBUTORS[@]}") +done + +# Remove duplicates +CONTRIBUTORS=($( echo "${CONTRIBUTORS[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + +for i in "${!CONTRIBUTORS[@]}"; do + if [ $(($i % 20)) -eq 0 ]; then + echo "" + fi + echo " "; + +done > CONTRIBUTORS.md