From b9d1e72fe1c7cc7be88aa2f3f45bc62bce633ae6 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Thu, 26 Dec 2024 10:40:19 +1100 Subject: [PATCH] Add Ruff formatting action --- .github/workflows/ruff.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 00000000..f807cfaf --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,23 @@ +name: Ruff Formatting +on: [pull_request] +jobs: + ruff: + if: ${{ github.actor != 'dependabot[bot]' }} # Do not run on commits created by dependabot + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the changed files. + contents: write # Allows reading and writing repository contents (e.g., commits) + pull-requests: write # Allows reading and writing pull requests + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + - uses: chartboost/ruff-action@v1 + with: + src: './jcvi ./tests' + args: 'format --target-version py310' + - uses: stefanzweifel/git-auto-commit-action@v5 + id: auto-commit-action + with: + commit_message: 'Style fixes by Ruff' \ No newline at end of file