Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter CIrcleCI build history by SSH rebuilds
#! /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
You can’t perform that action at this time.