diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 595dc55a40..063f5f4b5d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,6 +19,16 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 path: pull-request-checkout + + - 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 + git diff --name-only $BASE_SHA...$HEAD_SHA > changed_files.txt + CHANGED_FILES=$(cat changed_files.txt | grep -E '\.(js|ts|tsx)$' || true) + echo "::set-output name=changed::${CHANGED_FILES}" - name: Checkout OpenSearch Dashboards uses: actions/checkout@v2 @@ -56,16 +66,6 @@ jobs: working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} run: yarn osd bootstrap - - - 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 - git diff --name-only $BASE_SHA...$HEAD_SHA > changed_files.txt - CHANGED_FILES=$(cat changed_files.txt | grep -E '\.(js|ts|tsx)$' || true) - echo "::set-output name=changed::${CHANGED_FILES}" - name: Lint Changed Files run: |