Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 48c8c86

Browse files
authored
Update routes
1 parent 2cfb79e commit 48c8c86

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/sync.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'icons/**'
9-
- 'json/**'
8+
- 'icons/**'
9+
- 'json/**'
1010
workflow_dispatch:
1111

1212
jobs:
@@ -49,6 +49,7 @@ jobs:
4949
clean_and_move_json:
5050
runs-on: ubuntu-latest
5151
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.modified, 'json') }}
52+
5253
steps:
5354
- name: Checkout repository
5455
uses: actions/checkout@v3
@@ -70,12 +71,21 @@ jobs:
7071
mv json/* .
7172
rmdir json
7273
74+
- name: Update all JSON files to change image paths
75+
run: |
76+
# Loop through the JSON files and replace the paths
77+
for file in *.json; do
78+
echo "Processing $file"
79+
# Replace "/icons/" with "/assets/media/icons/"
80+
sed -i 's|"/icons/|"/assets/media/icons/|g' "$file"
81+
done
82+
7383
- name: Commit changes to JSON branch
7484
run: |
7585
git config user.name "github-actions[bot]"
7686
git config user.email "github-actions[bot]@users.noreply.github.com"
7787
git add .
78-
git commit -m "Moved json to root and cleaned JSON branch" || echo "No changes to commit"
88+
git commit -m "Updated image paths to /assets/media/icons/" || echo "No changes to commit"
7989
8090
- name: Push changes to JSON branch
8191
run: |

0 commit comments

Comments
 (0)