ALYYAN commited on
Commit
de8dfcb
·
unverified ·
1 Parent(s): 1e3a4fb

Update main.yaml

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yaml +7 -4
.github/workflows/main.yaml CHANGED
@@ -1,4 +1,4 @@
1
- # .github/workflows/main.yml
2
 
3
  name: Deploy App to Hugging Face Spaces
4
 
@@ -25,13 +25,11 @@ jobs:
25
  - name: Install dependencies
26
  run: pip install -r requirements.txt
27
 
28
- # --- THIS IS THE FIX ---
29
  - name: Log in to Hugging Face Hub and configure Git
30
  env:
31
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
32
  run: |
33
  pip install huggingface_hub
34
- # Use 'hf auth login' as recommended and add the git credential flag
35
  huggingface-cli login --token $HF_TOKEN --add-to-git-credential
36
 
37
  - name: Push to HF Space
@@ -39,7 +37,12 @@ jobs:
39
  HF_USERNAME: ${{ secrets.HF_USERNAME }}
40
  HF_SPACE_NAME: ${{ secrets.HF_SPACE_NAME }}
41
  run: |
42
- # The clone URL can be simpler now because Git is configured
 
 
 
 
 
43
  git clone https://huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME} hf_space_repo
44
 
45
  rsync -av --delete --exclude='.git/' --exclude='.github/' ./ hf_space_repo/
 
1
+ # .github/workflows/main.yml (Final Version with Git Config)
2
 
3
  name: Deploy App to Hugging Face Spaces
4
 
 
25
  - name: Install dependencies
26
  run: pip install -r requirements.txt
27
 
 
28
  - name: Log in to Hugging Face Hub and configure Git
29
  env:
30
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
31
  run: |
32
  pip install huggingface_hub
 
33
  huggingface-cli login --token $HF_TOKEN --add-to-git-credential
34
 
35
  - name: Push to HF Space
 
37
  HF_USERNAME: ${{ secrets.HF_USERNAME }}
38
  HF_SPACE_NAME: ${{ secrets.HF_SPACE_NAME }}
39
  run: |
40
+ # --- THIS IS THE FIX ---
41
+ # Set a dummy user identity for the git commit
42
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
43
+ git config --global user.name "GitHub Actions"
44
+
45
+ # Now the rest of the script will work
46
  git clone https://huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME} hf_space_repo
47
 
48
  rsync -av --delete --exclude='.git/' --exclude='.github/' ./ hf_space_repo/