Skip to content

Commit

Permalink
Lint only changed files in the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1g5 committed Dec 4, 2024
1 parent bbb7a96 commit 82c1d0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ jobs:
with:
fetch-depth: 0

- name: Get changed files
id: files
run: |
# Get a list of files changed between the last commit and the previous commit
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
echo "Changed files: $CHANGED_FILES"
echo "::set-output name=changed_files::$CHANGED_FILES"
- name: Lint Code Base
uses: super-linter/super-linter@v5
env:
Expand All @@ -29,3 +37,5 @@ jobs:
IGNORE_GITIGNORED_FILES: true
VALIDATE_JSCPD: false
JAVA_FILE_NAME: checkstyle.xml
with:
changed_files: ${{ steps.files.outputs.changed_files }}

0 comments on commit 82c1d0b

Please sign in to comment.