Skip to content

Commit 1da4d44

Browse files
committed
Fix pytorch checkout
1 parent 9d234d1 commit 1da4d44

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/build-test-reusable.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,21 @@ jobs:
7878
- name: Checkout repository
7979
uses: actions/checkout@v4
8080

81-
- name: Clone PyTorch
82-
if: inputs.env_manager != 'base'
81+
- name: Get pinned PyTorch ref
8382
shell: bash --noprofile --norc -eo pipefail {0}
83+
if: inputs.env_manager != 'base' && inputs.ref == ''
8484
run: |
85-
git clone --recursive https://github.com/pytorch/pytorch
86-
cd pytorch
87-
git checkout ${{ inputs.pytorch_ref }}
85+
PYTORCH_REF="$(<.github/pins/pytorch-upstream.txt)"
86+
echo "PYTORCH_REF=$PYTORCH_REF" | tee -a "$GITHUB_ENV"
8887
89-
- name: Load conda cache
88+
- name: Clone PyTorch repository
9089
if: inputs.env_manager != 'base'
90+
uses: actions/checkout@v4
91+
with:
92+
repository: pytorch/pytorch
93+
ref: ${{ inputs.pytorch_ref || env.PYTORCH_REF }}
94+
95+
- name: Load conda cache
9196
id: conda-cache
9297
uses: ./.github/actions/load
9398
env:

0 commit comments

Comments
 (0)