File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -13,23 +13,35 @@ jobs:
13
13
steps :
14
14
- uses : actions/checkout@v4
15
15
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
17
23
token : ${{ secrets.GITHUB_TOKEN }}
18
24
19
25
- name : Sync to main
20
26
run : |
21
27
SERVICE_PATH="${{ github.ref_name }}"
22
28
29
+ cd main
23
30
git config user.name 'github-actions[bot]'
24
31
git config user.email 'github-actions[bot]@users.noreply.github.com'
25
32
26
- git checkout main
27
- git pull origin main
28
-
33
+ # Remove old service directory
29
34
rm -rf "$SERVICE_PATH"
30
- git read-tree --prefix="$SERVICE_PATH/" -u ${{ github.ref_name }}
31
35
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 .
33
45
34
46
if ! git diff --staged --quiet; then
35
47
git commit -m "Update $SERVICE_PATH"
You can’t perform that action at this time.
0 commit comments