From 6be85888967569eadb678f0d41f49c6c980a819c Mon Sep 17 00:00:00 2001 From: Shubham Goyal Date: Wed, 4 Dec 2024 17:05:58 +0530 Subject: [PATCH] Lint only changed files in the PR --- .github/workflows/linter.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 56973f2aa9..9ca3b2493a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,6 +21,14 @@ jobs: with: fetch-depth: 0 + - name: Get changed files + id: files + uses: octokit/request-action@v2.4 + with: + route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Lint Code Base uses: super-linter/super-linter@v5 env: @@ -29,3 +37,5 @@ jobs: IGNORE_GITIGNORED_FILES: true VALIDATE_JSCPD: false JAVA_FILE_NAME: checkstyle.xml + with: + changed_files: ${{ steps.files.outputs.files }}