From 290637653d9f1f4c995ec318ccb7e6dba3da7c45 Mon Sep 17 00:00:00 2001 From: alex-rakowski Date: Sat, 29 Jun 2024 21:25:18 +0100 Subject: [PATCH] Add GitHub Actions workflow for running Ruff on changed files --- .github/workflows/changed_rust.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/changed_rust.yml diff --git a/.github/workflows/changed_rust.yml b/.github/workflows/changed_rust.yml new file mode 100644 index 000000000..10c83c924 --- /dev/null +++ b/.github/workflows/changed_rust.yml @@ -0,0 +1,30 @@ +name: Run Ruff on Changed Files + +on: + push: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Get all commits + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v35 + with: + files: '**/*.py' # Adjust pattern for your file types + + - name: Setup Python environment + uses: actions/setup-python@v3 + + - name: Install Ruff + run: pip install ruff + + - name: Run Ruff on changed files + run: | + ruff check ${{ steps.changed-files.outputs.all_changed_files }} +