Update Solutions (Wordle, Connections, Strands) #15
This file contains 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
name: Update Solutions (Wordle, Connections, Strands) | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Update Solutions | |
run: python update_solutions.py wordle connections strands | |
- name: Commit and push if it changed | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add ./solutions/wordle_solutions.json | |
git add ./solutions/connections_solutions.json | |
git add ./solutions/strands_solutions.json | |
git add ./solutions/strands/* | |
if git diff --staged --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m "Update solutions" | |
git push | |
fi | |