-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (25 loc) · 1015 Bytes
/
Copy pathvalidate.yml
File metadata and controls
32 lines (25 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Validate Wordle Solution List
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
check_wordle_list:
runs-on: ubuntu-latest
steps:
- name: Verify Wordle solution list line count
run: |
URL="https://gist.githubusercontent.com/cfreshman/a03ef2cba789d8cf00c08f767e0fad7b/raw/c46f451920d5cf6326d550fb2d6abb1642717852/wordle-answers-alphabetical.txt"
# Check HTTP status
status_code=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
if [ "$status_code" -ne 200 ]; then
echo "URL is not valid, returned status $status_code"
exit 1
fi
# Fetch content and remove blank/whitespace lines
total_words=$(curl -s "$URL" | sed '/^[[:space:]]*$/d' | wc -l)
if [ "$total_words" -lt 2300 ]; then
echo "Word list too short: $total_words words (minimum 2300 required)"
exit 2
fi
echo "Wordle solution list has $total_words words (ok)"