Skip to content

Commit 31ec2d0

Browse files
author
ICICLE Edge Admin
committed
VYP: Edited workflow sync file
1 parent 0de650b commit 31ec2d0

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/service-sync.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,35 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
with:
16-
fetch-depth: 0
16+
ref: ${{ github.ref_name }}
17+
path: source
18+
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
path: main
1723
token: ${{ secrets.GITHUB_TOKEN }}
1824

1925
- name: Sync to main
2026
run: |
2127
SERVICE_PATH="${{ github.ref_name }}"
2228
29+
cd main
2330
git config user.name 'github-actions[bot]'
2431
git config user.email 'github-actions[bot]@users.noreply.github.com'
2532
26-
git checkout main
27-
git pull origin main
28-
33+
# Remove old service directory
2934
rm -rf "$SERVICE_PATH"
30-
git read-tree --prefix="$SERVICE_PATH/" -u ${{ github.ref_name }}
3135
32-
git add "$SERVICE_PATH/"
36+
# Copy files from source to service directory
37+
mkdir -p "$SERVICE_PATH"
38+
cp -r ../source/* "$SERVICE_PATH/" 2>/dev/null || true
39+
cp -r ../source/.[^.]* "$SERVICE_PATH/" 2>/dev/null || true
40+
41+
# Remove .git directory if copied
42+
rm -rf "$SERVICE_PATH/.git"
43+
44+
git add .
3345
3446
if ! git diff --staged --quiet; then
3547
git commit -m "Update $SERVICE_PATH"

0 commit comments

Comments
 (0)