Skip to content

Fetch game compatibility #113

Fetch game compatibility

Fetch game compatibility #113

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 }}