Do full checkout in lint workflow to rebuild new Docker images (#119858)

From https://github.com/pytorch/pytorch/pull/119575, using `fetch-depth: 1` didn't work for `calculate-docker-image` when rebuilding a new one.  Specifically, doing a full checkout is needed for `git rev-parse HEAD~:.ci/docker` to get the Docker tag.

This shows up as a trunk failure after the recent Docker image update 507db17675
Pull Request resolved: https://github.com/pytorch/pytorch/pull/119858
Approved by: https://github.com/PaliC, https://github.com/clee2000, https://github.com/malfet
This commit is contained in:
Huy Do 2024-02-14 02:37:54 +00:00 committed by PyTorch MergeBot
parent 690f54b0f5
commit 179ecab7e7

View File

@ -21,7 +21,9 @@ jobs:
timeout: 120
runner: linux.2xlarge
docker-image: pytorch-linux-jammy-cuda11.8-cudnn8-py3.9-linter
fetch-depth: 1
# NB: A shallow checkout won't work here because calculate-docker-image requires a full checkout
# to run git rev-parse HEAD~:.ci/docker when a new image is needed
fetch-depth: 0
submodules: true
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
@ -35,7 +37,9 @@ jobs:
timeout: 120
runner: linux.2xlarge
docker-image: pytorch-linux-jammy-cuda11.8-cudnn8-py3.9-linter
fetch-depth: 1
# NB: A shallow checkout won't work here because calculate-docker-image requires a full checkout
# to run git rev-parse HEAD~:.ci/docker when a new image is needed
fetch-depth: 0
submodules: true
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |