Skip to content

Update GitHub Actions workflow to conditionally commit and push chang… #3

Update GitHub Actions workflow to conditionally commit and push chang…

Update GitHub Actions workflow to conditionally commit and push chang… #3

Workflow file for this run

name: Update README
on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run update script
run: python automata.py
- name: Commit and push if changed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "GitHub Action Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md
git diff --staged --quiet || git commit -m "Auto-update README.md"
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git main