fix: update main python script to remvoe setup #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: Steam Stats | |
on: | |
schedule: | |
# Runs every Monday at 12AM IST (UTC+5:30) | |
- cron: "30 18 * * 0" | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/steam-stats.yml' | |
- 'api/*.py' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
update-readme: | |
name: Steam Stats | |
runs-on: ubuntu-latest | |
container: | |
image: nicconike/steam-stats:latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Update Steam Stats in README | |
run: python3 api/main.py | |
env: | |
INPUT_STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }} | |
INPUT_STEAM_ID: ${{ vars.STEAM_ID }} | |
INPUT_STEAM_CUSTOM_ID: ${{ vars.STEAM_CUSTOM_ID }} | |
INPUT_WORKSHOP_STATS: True | |
INPUT_LOG_SCALE: True | |
HOME: /root | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
GITHUB_REF_NAME: ${{ github.ref_name }} | |
GITHUB_HEAD_REF: ${{ github.head_ref }} | |
- name: Configure Git & Commit Changes | |
run: | | |
git config --global --add safe.directory /__w/Steam-Stats/Steam-Stats | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
git add . | |
git commit -m "Updated Steam Stats" || echo "No changes to commit" | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
git pull --rebase origin ${{ github.head_ref }} | |
git push origin HEAD:${{ github.head_ref }} | |
else | |
git pull --rebase origin ${{ github.ref_name }} | |
git push origin HEAD:${{ github.ref_name }} | |
fi |