diff options
author | Vijayakumar A <36878324+kumvijaya@users.noreply.github.com> | 2024-09-13 11:22:04 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 11:22:04 +0530 |
commit | e62c021280a7a1bf1b4f7d84c0856487691177f1 (patch) | |
tree | d7c75bfd0a152a0a19de4a069d84360b4180b5d5 | |
parent | 765d2c107270ae4f0bf708259b7e071ac6942955 (diff) | |
parent | 8a3b25aee704abd4bf1605d14234e7909fa8e313 (diff) | |
download | vyos-workflow-test-temp-e62c021280a7a1bf1b4f7d84c0856487691177f1.tar.gz vyos-workflow-test-temp-e62c021280a7a1bf1b4f7d84c0856487691177f1.zip |
Merge pull request #54 from kumvijaya/current
T667: ruff cli
-rw-r--r-- | .github/workflows/ruff-lint.yml | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/.github/workflows/ruff-lint.yml b/.github/workflows/ruff-lint.yml index 6ba9447..e875dea 100644 --- a/.github/workflows/ruff-lint.yml +++ b/.github/workflows/ruff-lint.yml @@ -17,23 +17,33 @@ jobs: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Get changed py files - id: changed-py-files - uses: tj-actions/changed-files@v44 + - name: Filter changed Python files + id: py-filter + uses: dorny/paths-filter@v3 with: - files: | - **.py + list-files: json + filters: | + python: + - '**/*.py' - - name: Ruff Check - if: steps.changed-py-files.outputs.any_changed == 'true' - uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b - with: - args: check - changed-files: 'true' + - name: Get py changed files + if: steps.py-filter.outputs.python == 'true' + id: py-changed-files + run: | + files=$(echo '${{ steps.py-filter.outputs.python_files }}' | jq -r 'join(" ")') + echo "files=${files}" >> $GITHUB_OUTPUT - - name: Ruff Format - if: always() && steps.changed-py-files.outputs.any_changed == 'true' - uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b - with: - args: format --diff - changed-files: 'true'
\ No newline at end of file + - name: Install ruff + if: steps.py-filter.outputs.python == 'true' + run: | + pip install ruff==0.6.4 + + - name: Run ruff check on changed files + if: steps.py-filter.outputs.python == 'true' + run: | + ruff check ${{ steps.py-changed-files.outputs.files }} + + - name: Run ruff format on changed files + if: always() && steps.py-filter.outputs.python == 'true' + run: | + ruff format --diff ${{ steps.py-changed-files.outputs.files }}
\ No newline at end of file |