13
13
- name : Checkout GitHub Repository
14
14
uses : actions/checkout@v2
15
15
with :
16
- fetch-depth : 0 # Fetch the full history to ensure full context
16
+ fetch-depth : 0 # Fetch full history for context
17
17
18
18
# Step 2: Configure Git identity
19
19
- name : Configure Git Identity
@@ -37,18 +37,15 @@ jobs:
37
37
- name : Fetch GitLab qa branch
38
38
run : git fetch gitlab qa || true # Ensure GitLab qa branch is fetched
39
39
40
- # Step 6: Reconcile Divergent Histories
41
- - name : Reconcile Divergent Histories
40
+ # Step 6: Checkout GitLab qa branch
41
+ - name : Checkout GitLab qa branch
42
42
run : |
43
- # Checkout the current branch
44
- git checkout main
43
+ git checkout qa || git checkout -b qa gitlab/qa
45
44
46
- # Merge GitLab qa branch into GitHub main branch, allowing unrelated histories
47
- git merge gitlab/qa --allow-unrelated-histories --strategy-option=theirs || true
45
+ # Step 7: Merge GitHub main into GitLab qa
46
+ - name : Merge GitHub main into GitLab qa
47
+ run : git merge origin/main --allow-unrelated-histories --strategy-option=theirs || true
48
48
49
- # Force push to GitLab if necessary
50
- git push gitlab qa || git push --force gitlab qa
51
-
52
- # Step 7: Push Final Changes to GitLab qa branch
49
+ # Step 8: Push only to GitLab qa
53
50
- name : Push Final Changes to GitLab qa branch
54
- run : git push gitlab main: qa
51
+ run : git push gitlab qa
0 commit comments