Skip to content

Instantly share code, notes, and snippets.

@jbenden
Last active March 25, 2019 20:03
Show Gist options
  • Save jbenden/9a885d40321126f2786a5d8724ecc364 to your computer and use it in GitHub Desktop.
Save jbenden/9a885d40321126f2786a5d8724ecc364 to your computer and use it in GitHub Desktop.
Show GitHub project's status checks via shell/terminal
#!/bin/sh
REPO=$(git config hub.upstream || echo aircrack-ng/aircrack-ng)
SHA=$(git rev-parse ${1:-HEAD})
curl -sRL "https://api.github.com/repos/${REPO}/commits/${SHA}/status" | \
jq -c -r ".statuses | .[] | [(.state, .context)] | @tsv" | \
awk '/^failure/ { sub("failure", "\033[31mfailure\033[m") } /^success/ { sub("success", "\033[32msuccess\033[m") } { print($0) }' | \
sort -k 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment