Skip to content

Commit

Permalink
Test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Isengo1989 committed Dec 6, 2023
1 parent e17aa43 commit e7cbe82
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/scripts/watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Set the path to the snippets folder
WATCHER_PATH=$1
ERROR_FOUND=0
echo 0 > error.txt

# Find all files in the snippets folder
find $WATCHER_PATH -type f -print0 | while IFS= read -r -d '' file; do
Expand Down Expand Up @@ -36,20 +36,22 @@ find $WATCHER_PATH -type f -print0 | while IFS= read -r -d '' file; do
# 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
echo 1 > error.txt
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!"
else
echo "String not found! Please check $WATCHER_URL"
ERROR_FOUND=1
echo 1 > error.txt
fi

fi

done

ERROR_FOUND=$(cat error.txt)

if [ "$ERROR_FOUND" -eq 1 ]
then
echo "Error found, exiting..."
Expand Down

0 comments on commit e7cbe82

Please sign in to comment.