games-stats #54
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: Stats games | |
on: | |
repository_dispatch: | |
types: [games-stats] | |
inputs: | |
game: | |
description: 'Game to update stats' | |
required: true | |
default: '' | |
winner: | |
description: 'Winner of the game' | |
required: true | |
default: '' | |
jobs: | |
update-stats: | |
name: Update ${{ github.event.client_payload.game }} stats | |
concurrency: ci-${{ github.event.client_payload.game }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Set up Python ${{ env.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas | |
- name: Update csv | |
run: | | |
cd games | |
python update-stats.py "${{ github.event.client_payload.game }}" "${{ github.event.client_payload.winner }}" | |
- name: Pull modif | |
run: git pull | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update stats for ${{ github.event.client_payload.game }} | |