feat: new gifs, also test that gif links are valid
CI / Validate YAML (push) Successful in 4s

This commit is contained in:
2025-07-29 11:51:17 -07:00
parent 38ed110577
commit 020e0f31fb
2 changed files with 46 additions and 5 deletions
+8 -4
View File
@@ -35,8 +35,6 @@ matches:
replace: "https://c.tenor.com/hPsNhgYicFMAAAAC/tenor.gif" replace: "https://c.tenor.com/hPsNhgYicFMAAAAC/tenor.gif"
- trigger: "gif.ignore" - trigger: "gif.ignore"
replace: "https://c.tenor.com/AlUkiGkR2j8AAAAC/tenor.gif" replace: "https://c.tenor.com/AlUkiGkR2j8AAAAC/tenor.gif"
- trigger: "gif.smoke"
replace: "https://media.tenor.com/FJ8kmkejJx4AAAPo/anime-cool.gif"
- trigger: "gif.shh" - trigger: "gif.shh"
replace: "https://c.tenor.com/P32p3dPsEgkAAAAC/tenor.gif" replace: "https://c.tenor.com/P32p3dPsEgkAAAAC/tenor.gif"
- trigger: "gif.giggle" - trigger: "gif.giggle"
@@ -44,7 +42,7 @@ matches:
- trigger: "gif.wave" - trigger: "gif.wave"
replace: "https://c.tenor.com/FvthnLepGgAAAAAC/tenor.gif" replace: "https://c.tenor.com/FvthnLepGgAAAAAC/tenor.gif"
- trigger: "gif.salute" - trigger: "gif.salute"
replace: "https://c.tenor.com/DBT7E154-pgAAAAC/tenor.gif" replace: "https://c.tenor.com/NahzVADyncsAAAAd/tenor.gif"
- trigger: "gif.thank" - trigger: "gif.thank"
replace: "https://c.tenor.com/xITmP6QW3woAAAAC/tenor.gif" replace: "https://c.tenor.com/xITmP6QW3woAAAAC/tenor.gif"
- trigger: "gif.peek" - trigger: "gif.peek"
@@ -56,7 +54,7 @@ matches:
- trigger: "gif.objection" - trigger: "gif.objection"
replace: "https://c.tenor.com/kHS2x_pJVrwAAAAC/tenor.gif" replace: "https://c.tenor.com/kHS2x_pJVrwAAAAC/tenor.gif"
- trigger: "gif.dance" - trigger: "gif.dance"
replace: "https://media.tenor.com/mGmDiWX42y0AAAAi/anime-dance-vyn-anime-dance.gif" replace: "https://c.tenor.com/g9xOFVXmNx0AAAAd/tenor.gif"
- trigger: "gif.dancy" - trigger: "gif.dancy"
replace: "https://c.tenor.com/m21RwoBHceEAAAAd/tenor.gif" replace: "https://c.tenor.com/m21RwoBHceEAAAAd/tenor.gif"
- trigger: "gif.cheer" - trigger: "gif.cheer"
@@ -79,3 +77,9 @@ matches:
replace: "https://c.tenor.com/d8vq5hthkAoAAAAC/tenor.gif" replace: "https://c.tenor.com/d8vq5hthkAoAAAAC/tenor.gif"
- trigger: "gif.psychic" - trigger: "gif.psychic"
replace: "https://c.tenor.com/ETmw31CyCmQAAAAd/tenor.gif" replace: "https://c.tenor.com/ETmw31CyCmQAAAAd/tenor.gif"
- trigger: "gif.wiggle"
replace: "https://c.tenor.com/6bGvizlex6oAAAAd/tenor.gif"
- trigger: "gif.lurk"
replace: "https://c.tenor.com/Bh5FPIsK2xEAAAAd/tenor.gif"
- trigger: "gif.stare"
replace: "https://c.tenor.com/VC3EDnfJmKEAAAAd/tenor.gif"
+37
View File
@@ -49,7 +49,44 @@ else
echo "Trigger \"$dupe\" found in:" echo "Trigger \"$dupe\" found in:"
grep -l "trigger: \"$dupe\"" "$MATCH_DIR"/*.y*ml grep -l "trigger: \"$dupe\"" "$MATCH_DIR"/*.y*ml
done done
exit 1
fi fi
# Clean up # Clean up
rm "$ALL_TRIGGERS" rm "$ALL_TRIGGERS"
### Now we test that all gifs.yml replace values match "c.tenor.com".
# Temporary file to store all replace values
REPLACE_VALUES=$(mktemp)
# Read gifs.yml file and extract replace values
echo "Scanning gifs.yml for replace values..."
if [ -f "$MATCH_DIR/gifs.yml" ]; then
# We match lines like: ` replace: "https://c.tenor.com/some-value/tenor.gif"`
grep -E '^\s*replace:' "$MATCH_DIR/gifs.yml" | sed 's/.*replace:\s*"\([^"]*\)".*/\1/' >> "$REPLACE_VALUES"
else
echo "Error: gifs.yml file not found in $MATCH_DIR directory!"
rm "$REPLACE_VALUES"
exit 1
fi
# Check if we found any replace values
if [ ! -s "$REPLACE_VALUES" ]; then
echo "No replace values found in gifs.yml. Check file format."
rm "$REPLACE_VALUES"
exit 1
fi
# Check if all replace values start with "https://c.tenor.com/"
echo -e "\nChecking replace values in gifs.yml..."
INVALID_REPLACE=$(grep -v '^https://c\.tenor\.com/' "$REPLACE_VALUES")
if [ -z "$INVALID_REPLACE" ]; then
echo "Success: All replace values in gifs.yml are valid!"
else
echo "Error: Invalid replace values found in gifs.yml:"
echo "$INVALID_REPLACE"
fi
# This must always be the final line, so that CI can detect success. If you want to exit with a failure, do so at the conditional point.
exit 0