-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.35 KB
/
sync-dev.yml
File metadata and controls
42 lines (36 loc) · 1.35 KB
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
42
# =============================================================================
# Sync Dev Branch Workflow
# =============================================================================
# Triggered: When a PR from dev to main is merged
# Purpose: Back-merge main to dev to keep branches in sync
# Runner: Self-hosted runner on VCL1
# Note: Prevents divergence between dev and main branches
# =============================================================================
name: Sync Dev Branch
on:
pull_request:
types: [closed]
branches:
- main
jobs:
sync-dev:
name: Back-merge main to dev
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'dev'
runs-on: [self-hosted, linux, x64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Merge main back to dev
run: |
git fetch origin dev
git checkout dev
git merge main -m "Auto-sync: merge main back to dev after PR merge"
git push origin dev