diff options
author | Vijayakumar A <36878324+kumvijaya@users.noreply.github.com> | 2024-09-12 00:55:44 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-12 00:55:44 +0530 |
commit | 46c208142a528a8d09600827a07238f6dbc79e37 (patch) | |
tree | 9993e52f0b1e336f9d9d1804d935eeb4717266dd /.github/workflows/ruff-lint.yml | |
parent | 6482aeb3c474370bdd667fc038ef5f2ccc6353fa (diff) | |
parent | 505fd94fd48b545da18487ce3aa202a92e6835e7 (diff) | |
download | vyos-workflow-test-temp-46c208142a528a8d09600827a07238f6dbc79e37.tar.gz vyos-workflow-test-temp-46c208142a528a8d09600827a07238f6dbc79e37.zip |
Merge pull request #50 from kumvijaya/current
Test 1
Diffstat (limited to '.github/workflows/ruff-lint.yml')
-rw-r--r-- | .github/workflows/ruff-lint.yml | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/.github/workflows/ruff-lint.yml b/.github/workflows/ruff-lint.yml index 4a87521..6ba9447 100644 --- a/.github/workflows/ruff-lint.yml +++ b/.github/workflows/ruff-lint.yml @@ -6,10 +6,34 @@ on: pull_request jobs: ruff-lint: runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: read steps: - - uses: actions/checkout@v4 + - name: Checkout Head + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: chartboost/ruff-action@491342200cdd1cf4d5132a30ddc546b3b5bc531b + 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 + with: + files: | + **.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: 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 |