Fetch game compatibility #108
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: Fetch game compatibility | |
on: | |
workflow_dispatch: # Allows manual triggering of the workflow | |
workflow_run: | |
workflows: ["Update Game Patches JSON file from Github API"] | |
types: | |
- completed | |
jobs: | |
fetch_game_compatibility: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests python-dotenv | |
- name: Run the Python script | |
run: python Scripts/game_compatibility.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and push changes | |
if: success() | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add Database/game_compatibility.json | |
git diff-index --quiet HEAD || git commit -m "Update game compatibility" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |