Merge pull request #74 from Mojirade18/add-python-math-rush #38
This file contains hidden or 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: Update Game Index | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| update-index: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 # Important for pushing commits back | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Update INDEX.md | |
| run: | | |
| python update_index.py | |
| - name: Commit and push changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add INDEX.md | |
| if [[ -n "$(git status --porcelain INDEX.md)" ]]; then | |
| git commit -m "Auto-update INDEX.md with new games [skip ci]" | |
| git push origin HEAD:${GITHUB_REF#refs/heads/} | |
| else | |
| echo "No changes to INDEX.md" | |
| fi |