Skip to content

Instantly share code, notes, and snippets.

@dennisoelkers
Last active April 22, 2021 14:09
Show Gist options
  • Save dennisoelkers/baa2597565589d67928c23cf87dbd1d7 to your computer and use it in GitHub Desktop.
Save dennisoelkers/baa2597565589d67928c23cf87dbd1d7 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Returning the status of all open PRs of $1, execute it in the directory of the git repository
# Perfect in combination with `watch -n 30 -c pr-check`
GITHUB_USER=dennisoelkers
if [ "$1" != "" ]; then
GITHUB_USER=$1
fi
for i in `hub pr list -L 1000 -f "%au %i,%sH,%H,%n"|grep ${GITHUB_USER}|awk '{ print $2; }'`; do
HEAD_COMMIT=`echo $i | cut -d ',' -f 2`
PR_NUMBER=`echo $i | cut -d ',' -f 1`
BRANCH=`echo $i | cut -d ',' -f 3`
echo "\033[1;33m${BRANCH} (${PR_NUMBER}):\033[0m"; hub ci-status --color -v ${HEAD_COMMIT};
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment