Ensure correct LFS tracking in .gitattributes and update push strategy in GitHub Actions workflow
Browse files
.github/workflows/main.yml
CHANGED
@@ -25,13 +25,11 @@ jobs:
|
|
25 |
git config --global user.email "[email protected]"
|
26 |
git config --global user.name "GitHub Actions Bot"
|
27 |
|
28 |
-
- name:
|
29 |
run: |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
git commit -m "Track *.sqlite3 files with Git LFS" || echo "No changes to commit"
|
34 |
-
fi
|
35 |
|
36 |
- name: Commit large files
|
37 |
run: |
|
@@ -43,4 +41,5 @@ jobs:
|
|
43 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
44 |
run: |
|
45 |
git remote set-url origin https://Oxbridge-Economics:[email protected]/spaces/Oxbridge-Economics/Mailbox
|
46 |
-
git push origin main --force
|
|
|
|
25 |
git config --global user.email "[email protected]"
|
26 |
git config --global user.name "GitHub Actions Bot"
|
27 |
|
28 |
+
- name: Ensure .gitattributes is correct
|
29 |
run: |
|
30 |
+
echo "*.sqlite3 filter=lfs diff=lfs merge=lfs -text" > .gitattributes
|
31 |
+
git add .gitattributes
|
32 |
+
git commit -m "Ensure correct LFS tracking in .gitattributes" || echo "No changes to commit"
|
|
|
|
|
33 |
|
34 |
- name: Commit large files
|
35 |
run: |
|
|
|
41 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
42 |
run: |
|
43 |
git remote set-url origin https://Oxbridge-Economics:[email protected]/spaces/Oxbridge-Economics/Mailbox
|
44 |
+
git pull origin main --rebase || (git rebase --abort && git push origin main --force) # Fallback to force push if rebase fails
|
45 |
+
git push origin main
|