Last active
August 29, 2015 14:13
-
-
Save jsvd/c4b030daf6c76ca8b77a to your computer and use it in GitHub Desktop.
list plugins that have diferences between the last tag and master
This file contains hidden or 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
# needs a repos variable with a list of organization/plugin items | |
echo "repository,last_tag,commits_ahead_master,changes_against_master" | |
for repo in "${repos[@]}"; do | |
last_tag=`curl -u "$CREDENTIALS" -s https://api.github.com/repos/$repo/tags | jq -r ".[0].name"` | |
if [ $last_tag == "null" ]; then | |
continue | |
fi | |
ahead_commits=`curl -u "$CREDENTIALS" -s https://api.github.com/repos/$repo/compare/$last_tag...master | jq -r ".ahead_by"` | |
if [ $ahead_commits != "null" ] && [ "$ahead_commits" -gt 0 ]; then | |
num_changes=`curl -u "$CREDENTIALS" -s https://api.github.com/repos/$repo/compare/$last_tag...master | jq -r ".files[].changes" |awk '{total += $1} END {print total}'` | |
echo "$repo,$last_tag,$ahead_commits,$num_changes" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment