Last active
June 9, 2020 07:34
-
-
Save steebchen/80fb6e3a60aec0f095090618f90473ec to your computer and use it in GitHub Desktop.
Check if a given Github Action succeeds
This file contains hidden or 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/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