diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ef06d34a9..2258d433f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,8 +1,25 @@ -name: Ruff +# name: Ruff +# on: [ push, pull_request ] +# jobs: +# ruff: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - uses: chartboost/ruff-action@v1 +name: Ruff on Changed Files + on: [ push, pull_request ] + jobs: ruff: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: chartboost/ruff-action@v1 + - uses: tj-actions/changed-files@v35 # Identify changed files + id: changed_files + - name: Run Ruff only on changes (optional) + run: | + if [[ $(echo ${{ steps.changed_files.outputs.all_changed_files }} | grep -q ".") ]]; then + # Use ruff-action with `--check` flag here + uses: chartboost/ruff-action@v1 with: args: --check + fi \ No newline at end of file