diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 99de91a5c4..dde3820d68 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,21 +54,19 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - - name: Get list of changed files - id: files - run: | - BASE_SHA="${{ github.event.pull_request.base.sha }}" - HEAD_SHA="${{ github.event.pull_request.head.sha }}" - git fetch origin $BASE_SHA - CHANGED_FILES=$(git diff --name-only $BASE_SHA...$HEAD_SHA | grep -E "\.(js|ts|tsx)$") - echo "::set-output name=changed::${CHANGED_FILES}" - + - name: Get changed files + id: changed-files + uses: jitterbit/get-changed-files@v1 + with: + format: 'json' + - name: Lint Changed Files run: | - CHANGED_FILES="${{ steps.files.outputs.changed }}" + CHANGED_FILES="${{ steps.changed-files.outputs.all }}" if [ -n "$CHANGED_FILES" ]; then echo "Linting changed files..." + # Replace this with your linting command, making sure to pass in the changed files yarn lint $CHANGED_FILES else - echo "No JavaScript/TypeScript files to lint." + echo "No files to lint." fi