diff --git a/.github/workflows/fixer.yml b/.github/workflows/fixer.yml new file mode 100644 index 000000000..3c451f05a --- /dev/null +++ b/.github/workflows/fixer.yml @@ -0,0 +1,34 @@ +name: Fixer + +on: [push, pull_request] + +concurrency: + group: fixer-${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || github.workflow_ref }} + cancel-in-progress: true + +jobs: + ruff-lint: + name: Ruff + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - uses: chartboost/ruff-action@v1 + with: + args: 'check --preview --fix-only' + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'style fixes by ruff'