Skip to content

Fetch game compatibility #10

Fetch game compatibility

Fetch game compatibility #10

name: Fetch game compatibility
on:
workflow_dispatch: # Allows manual triggering of the workflow
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: Configure Git
run: |
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"
- name: Create a new branch
run: |
git checkout -b update-game-compatibility
- name: Add changes
run: |
git add .
git commit -m "Update game compatibility data"
- name: Push changes
run: |
git push origin update-game-compatibility
- name: Create Pull Request using REST API
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls \
-d '{
"title": "Update Game Compatibility",
"body": "This PR updates the game compatibility data.",
"head": "update-game-compatibility",
"base": "main"
}'