Spaces:
Sleeping
Sleeping
Update update_space_2.yaml
Browse files
.github/workflows/update_space_2.yaml
CHANGED
@@ -40,14 +40,20 @@ jobs:
|
|
40 |
|
41 |
- name: Add Hugging Face Space as remote (loop through each space)
|
42 |
run: |
|
43 |
-
git remote add ${{ steps.get_space_name.outputs.value }} https
|
44 |
-
git config --add remote.$
|
|
|
45 |
|
46 |
- name: Get changed files
|
47 |
id: changed_files
|
48 |
run: |
|
49 |
git diff --name-only origin/main HEAD
|
50 |
-
|
51 |
- name: Push only changed files (loop through each space)
|
52 |
run: |
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
- name: Add Hugging Face Space as remote (loop through each space)
|
42 |
run: |
|
43 |
+
git remote add ${{ steps.get_space_name.outputs.value }} https://huggingface.co/spaces/david-oplatka/${{ steps.get_space_name.outputs.value }}.git
|
44 |
+
git config --add remote.${{ steps.get_space_name.outputs.value }}.oauth_token ${{ secrets.HF_TOKEN }}
|
45 |
+
|
46 |
|
47 |
- name: Get changed files
|
48 |
id: changed_files
|
49 |
run: |
|
50 |
git diff --name-only origin/main HEAD
|
51 |
+
|
52 |
- name: Push only changed files (loop through each space)
|
53 |
run: |
|
54 |
+
changed_files=$(echo "${{ steps.changed_files.outputs.value }}")
|
55 |
+
for file in $changed_files; do
|
56 |
+
git add $file
|
57 |
+
git commit -m "Updating $file"
|
58 |
+
git push ${{ steps.get_space_name.outputs.value }} main
|
59 |
+
done
|