diff --git a/.github/workflows/sycl_precommit.yml b/.github/workflows/sycl_precommit.yml index 30d387ab6be65..86ed5c741bb42 100644 --- a/.github/workflows/sycl_precommit.yml +++ b/.github/workflows/sycl_precommit.yml @@ -27,11 +27,13 @@ jobs: container: image: ghcr.io/intel/llvm/sycl_ubuntu2004_nightly:no-drivers steps: + - name: 'PR commits + 1' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - fetch-depth: 2 + fetch-depth: ${{ env.PR_FETCH_DEPTH }} - name: Run clang-format uses: ./devops/actions/clang-format diff --git a/devops/actions/clang-format/action.yml b/devops/actions/clang-format/action.yml index 04b7230f2d2ba..4ea522f8ae7ff 100644 --- a/devops/actions/clang-format/action.yml +++ b/devops/actions/clang-format/action.yml @@ -7,7 +7,8 @@ runs: shell: bash {0} run: | git config --global --add safe.directory /__w/llvm/llvm - git clang-format ${GITHUB_SHA}^1 + git fetch origin sycl + git clang-format ${GITHUB_SHA} git diff > ./clang-format.patch # Add patch with formatting fixes to CI job artifacts - uses: actions/upload-artifact@v1