Skip to content

Commit

Permalink
Add better error handline
Browse files Browse the repository at this point in the history
  • Loading branch information
Isengo1989 committed Dec 6, 2023
1 parent dd68652 commit a63e39d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ file_contains(){

# Check if $WATCHER_CONTAINS contains the string "null" and is therefore empty or not set
if [[ $WATCHER_CONTAINS == "null" ]]; then
echo "No contain set"
ERROR_FOUND=1
return 1
fi
# Check if $WATCHER_CONTAINS contains the string $WATCHER_CONTAINS and if not call the Slack webhook
if [[ $FILE_CONTENT == *"$WATCHER_CONTAINS"* ]]; then
echo "String found - nice!"
echo "String found!"
else
echo "String not found - not nice! Please check $WATCHER_URL"
echo "String not found! Please check $WATCHER_URL"
ERROR_FOUND=1
#curl -X POST -H 'Content-type: application/json' --data '{"text":"String not found - not nice!"}' $SLACK_WEBHOOK
fi
Expand Down

0 comments on commit a63e39d

Please sign in to comment.