contributors 554 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -e
  3. function usage() {
  4. >&2 cat << EOM
  5. Print the list of github contributors for the release
  6. Usage:
  7. $0 <previous release tag>
  8. EOM
  9. exit 1
  10. }
  11. [[ -n "$1" ]] || usage
  12. PREV_RELEASE=$1
  13. BRANCH="$(git rev-parse --abbrev-ref HEAD)"
  14. URL="https://api.github.com/repos/docker/compose/compare"
  15. contribs=$(curl -sf "$URL/$PREV_RELEASE...$BRANCH" | \
  16. jq -r '.commits[].author.login' | \
  17. sort | \
  18. uniq -c | \
  19. sort -nr)
  20. echo "Contributions by user: "
  21. echo "$contribs"
  22. echo
  23. echo "$contribs" | awk '{print "@"$2","}' | xargs