Update Games #92
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 Games | |
on: | |
schedule: | |
- cron: '0 10 * * *' # Run once a day at 5 AM CST (10 AM UTC) | |
workflow_dispatch: # Allow manual triggering | |
# Add this permissions block | |
permissions: | |
contents: write | |
jobs: | |
update-games: | |
runs-on: ubuntu-latest | |
environment: YT | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests google-api-python-client fuzzywuzzy python-Levenshtein beautifulsoup4 | |
- name: Update games | |
run: | | |
python .github/scripts/update_games.py | |
- name: Run YouTube script | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
run: python .github/scripts/yt_timestamps.py | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email "github-actions@github.com" | |
git config --global user.name "GitHub Actions" | |
git add content/games.md | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update games" && git push) |