edjx22 commited on
Commit
f219134
·
unverified ·
1 Parent(s): c48d836

Update main.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +7 -9
.github/workflows/main.yml CHANGED
@@ -10,18 +10,16 @@ jobs:
10
  steps:
11
  - uses: actions/checkout@v3
12
  with:
13
- fetch-depth: 0 # Ensures full history is fetched
14
  lfs: true
15
 
16
- - name: Pull latest changes
17
- run: git pull origin main # Pull latest changes from remote before pushing
18
 
19
- - name: Check status after pull
20
- run: git status
21
 
22
-
23
- - name: Force push to hub
24
  env:
25
  HF_TOKEN: ${{ secrets.token }}
26
- run: git push --force https://j565xu:$HF_TOKEN@huggingface.co/spaces/j565xu/test main
27
-
 
10
  steps:
11
  - uses: actions/checkout@v3
12
  with:
13
+ fetch-depth: 0
14
  lfs: true
15
 
16
+ - name: Pull changes from Hugging Face
17
+ run: git pull https://huggingface.co/spaces/j565xu/test main
18
 
19
+ - name: Resolve conflicts automatically (if safe)
20
+ run: git merge --strategy-option theirs || true # Keeps Hugging Face changes if possible
21
 
22
+ - name: Push merged changes to Hugging Face
 
23
  env:
24
  HF_TOKEN: ${{ secrets.token }}
25
+ run: git push https://j565xu:$HF_TOKEN@huggingface.co/spaces/j565xu/test main