@@ -14,30 +14,27 @@ jobs:
14
14
uses : actions/checkout@v4
15
15
with :
16
16
ref : ' demo'
17
- token : ${{ secrets.DEMO_UPDATE_PAT }}
17
+ token : ${{ secrets.DEMO_UPDATE_PAT }} # Ensure this secret exists
18
18
fetch-depth : 0 # Needed for merge history
19
19
20
20
# Configure Git user for the commit
21
21
- name : Configure Git User
22
22
run : |
23
- # Using generic bot details, you can change these if desired
24
23
git config user.name "GitHub Actions Bot"
25
24
git config user.email "actions-bot@github.com"
26
25
27
26
# Fetch the latest changes from the remote, including main
28
27
- name : Fetch origin
29
28
run : git fetch origin
30
29
31
- # Perform the merge from main into the currently checked out demo branch
32
- - name : Merge main into demo
30
+ # Perform the merge from main into demo
31
+ - name : Merge main into demo (preferring main for non-demo conflicts)
33
32
run : |
34
- # Merge main. --no-ff creates a merge commit.
35
- # Git automatically uses .gitattributes in the demo branch.
36
- git merge --no-ff origin/main -m "Auto-merge main into demo"
37
- # This step might fail on complex conflicts not handled by merge=ours.
33
+ # Merge main using -X theirs to auto-resolve non-demo conflicts by taking main's version.
34
+ # .gitattributes merge=ours for demo folders takes precedence.
35
+ git merge --no-ff -X theirs origin/main -m "Auto-merge main into demo (preferring main for conflicts)"
38
36
39
- # Push the merge commit back to the demo branch
37
+ # Push the merge commit (and resolved changes) back to the demo branch
40
38
- name : Push changes to demo
41
39
run : |
42
40
git push origin demo
43
- # actions/checkout@v4 with token handles auth for push
0 commit comments