Skip to content

Instantly share code, notes, and snippets.

@steebchen
Last active June 9, 2020 07:34
Show Gist options
  • Save steebchen/80fb6e3a60aec0f095090618f90473ec to your computer and use it in GitHub Desktop.
Save steebchen/80fb6e3a60aec0f095090618f90473ec to your computer and use it in GitHub Desktop.
Check if a given Github Action succeeds
#!/bin/sh
# This script checks if the prisma e2e test workflow passes
# Check the end of the file for usage
check() {
str=$(curl -s "https://github.com/$1/workflows/$2/badge.svg")
case "$str" in
*"passing"*)
echo "no status, waiting..."
sleep 10
check $1 $2
return
;;
esac
case "$str" in
*passing*)
echo "success"
exit 0
;;
esac
echo "fail"
exit 1
}
# Syntax:
# check <repo slug> <workflow name>
check prisma/e2e-tests test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment