ah yes the classic race condition #430
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
| # https://docs.astral.sh/ruff | |
| name: ci | |
| on: | |
| push: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| codespell: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: pipx run codespell | |
| ruff_check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - run: pipx run ruff check --output-format=github | |
| ruff_format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Format with Ruff | |
| run: pipx run ruff format . | |
| - name: Commit formatting fixes | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| if git diff --quiet; then | |
| echo "✅ No formatting changes needed" | |
| exit 0 | |
| fi | |
| git add -A | |
| git commit -m "style: apply ruff formatting [skip ci]" | |
| for i in 1 2 3; do | |
| git pull --rebase origin main && git push && break | |
| echo "⚠️ Push failed, retrying ($i/3)..." | |
| sleep 5 | |
| done |