@@ -71,26 +71,34 @@ jobs:
71
71
# only Pytorch has/uses notebooks
72
72
submodules : ${{ matrix.pkg-name == 'pytorch' }}
73
73
lfs : false # Disable LFS during checkout to avoid auth issues
74
- - name : Setup LFS and fetch notebooks manually
74
+ - name : Configure Git LFS authentication
75
75
if : ${{ matrix.pkg-name == 'pytorch' }}
76
+ env :
77
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76
78
run : |
77
- cd _notebooks
78
-
79
- # Skip LFS entirely - download files directly from GitHub
80
- echo "Bypassing LFS - downloading files directly via GitHub API..."
81
-
82
- # List LFS tracked files and download them directly
83
- git lfs ls-files --name-only | while read file; do
84
- if [ -f "$file" ]; then
85
- echo "Downloading $file..."
86
- # Download the actual file content from GitHub raw API
87
- curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
88
- -L "https://github.com/Lightning-AI/lightning-tutorials/raw/HEAD/$file" \
89
- -o "$file"
90
- fi
91
- done
92
-
93
- echo "Direct download completed"
79
+ # Configure Git LFS with proper authentication using recommended approach
80
+ git config --global credential.helper store
81
+ echo "https://${{ github.actor }}:${GH_TOKEN}@github.com" > ~/.git-credentials
82
+
83
+ # Set LFS configuration to use GitHub token
84
+ git config --global lfs."https://github.com/".access basic
85
+ git config --global lfs."https://github.com/".locksverify false
86
+
87
+ - name : Fetch LFS objects for submodule
88
+ if : ${{ matrix.pkg-name == 'pytorch' }}
89
+ working-directory : _notebooks
90
+ env :
91
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
+ run : |
93
+ # Initialize LFS in submodule context
94
+ git lfs install --local
95
+
96
+ # Set the correct LFS endpoint with authentication (using the actual repo name)
97
+ git config lfs.url "https://${{ github.actor }}:${GH_TOKEN}@github.com/Lightning-AI/tutorials.git/info/lfs"
98
+
99
+ # Fetch and checkout LFS objects
100
+ git lfs fetch --all
101
+ git lfs checkout
94
102
- uses : actions/setup-python@v6
95
103
with :
96
104
python-version : " 3.10"
0 commit comments