diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e7425e91147d8..aba7299455366 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -66,10 +66,13 @@ jobs: remove-dotnet: 'true' remove-android: 'true' remove-haskell: 'true' + - name: 'PR commits + 1' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: - fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} - name: 'Check Changed files' id: changed-files-cpp uses: tj-actions/changed-files@v41