diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index 34a6113..8a6640b 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -20,8 +20,17 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Get number of commits in push + id: payload + if: github.event_name == 'push' + env: + COMMITS: ${{ toJson(github.event.commits) }} + run: | + echo "commit_length=$(echo $COMMITS | jq '. | length')" >> $GITHUB_OUTPUT + - name: Checking out ${{ steps.payload.outputs.commit_length || '1' }} commits uses: actions/checkout@v4 + with: + fetch-depth: ${{ steps.payload.outputs.commit_length || '1' }} - name: Setup Ktlint uses: ./.github/actions/setup-ktlint - run: |