Created
June 28, 2018 13:29
-
-
Save eddiewebb/de8b147e3fe8473349d32abedf909103 to your computer and use it in GitHub Desktop.
Filter CIrcleCI build history by SSH rebuilds
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
#! /bin/bash | |
# | |
# This script pulls recent circleci build history, using jq to filter by ssh rebuilds, and printing the summary | |
# Requires `jq` and a CIRCLE_TOKEN | |
# | |
CCI_PROJECT="orgname/projectname" | |
curl -sSL -u ${CIRCLE_TOKEN}: 'https://circleci.com/api/v1.1/project/github/${CCI_PROJECT}?offset=0&limit=100' | jq -r '.[] | select(.ssh_users != []) | [.build_url, .ssh_users[0].login] | @csv' | |
# alternately use https://circleci.com/api/v1.1/recent-builds?offset=0&limit=100 for last N builds in all visible orgs based on users API token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment