Improve run back #130
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: Ruff Auto-Format | |
| on: | |
| pull_request: | |
| paths: | |
| - "**/*.py" | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Install dependencies (including dev) | |
| run: uv sync --all-groups --frozen | |
| - name: Run Ruff format | |
| run: uv run ruff format . | |
| - name: Commit and push changes | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: auto-format Python code with Ruff" | |
| git push | |
| fi |