Skip to content

Commit d0feb5c

Browse files
committed
Bypass LFS completely - download files directly via GitHub API
1 parent 5127af5 commit d0feb5c

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

.github/workflows/docs-build.yml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,23 @@ jobs:
7474
- name: Setup LFS and fetch notebooks manually
7575
if: ${{ matrix.pkg-name == 'pytorch' }}
7676
run: |
77-
# Configure Git to use token for all GitHub operations
78-
git config --global credential.helper store
79-
echo "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com" > ~/.git-credentials
80-
81-
# Navigate to submodule and configure LFS with correct URL
8277
cd _notebooks
8378
84-
# Check current remote and LFS config
85-
echo "Current remote:"
86-
git remote -v
87-
echo "Current LFS config:"
88-
git config --list | grep lfs || true
89-
90-
# Set the correct remote URL with token
91-
git remote set-url origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/Lightning-AI/lightning-tutorials.git"
92-
93-
# Configure LFS more aggressively
94-
git config lfs.url "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/Lightning-AI/lightning-tutorials.git/info/lfs"
95-
git config --add lfs.https://github.com/Lightning-AI/tutorials.git/info/lfs.access basic
96-
git config --add lfs.https://github.com/Lightning-AI/lightning-tutorials.git/info/lfs.access basic
97-
git config credential.helper store
98-
99-
# Install and configure LFS
100-
git lfs install
101-
102-
# Try to fetch with environment variable override
103-
export GIT_LFS_ENDPOINT="https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/Lightning-AI/lightning-tutorials.git/info/lfs"
104-
105-
# Fetch LFS objects
106-
git lfs fetch --all
107-
git lfs checkout
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"
10894
- uses: actions/setup-python@v6
10995
with:
11096
python-version: "3.10"

0 commit comments

Comments
 (0)