-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1007 Bytes
/
sync-development-to-main.yml
File metadata and controls
41 lines (33 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Sync Development to Main
on:
push:
branches:
- development
permissions:
contents: write
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch and Checkout Main
run: |
git fetch origin
git checkout main
- name: Merge Development into Main
run: |
if ! git merge --no-ff development -m "Automated merge from development to main"; then
echo "Merge conflict detected, auto-resolving README.md..."
git checkout main -- README.md 2>/dev/null || git rm README.md 2>/dev/null || true
git add -A
git commit --no-edit
fi
- name: Push Changes
run: git push origin main