Skip to content

Commit 257836c

Browse files
committed
.github/workflows/sync_branches.yml: Add workflow
1 parent 1583c8d commit 257836c

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Sync Commits to Stable Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- hdmi_frl
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
sync:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Configure Git
21+
run: |
22+
git config user.name "github-actions[bot]"
23+
git config user.email "github-actions[bot]@users.noreply.github.com"
24+
25+
- name: Sync Commits
26+
run: |
27+
COMMITS=$(git log origin/master..origin/${{ github.ref_name }} --pretty=format:"%H" | tac)
28+
29+
if [ -z "$COMMITS" ]; then
30+
echo "No new commits to sync."
31+
exit 0
32+
fi
33+
34+
git checkout hdmi_frl_stable
35+
36+
for commit in $COMMITS; do
37+
echo "Cherry-picking $commit"
38+
git cherry-pick $commit || (git cherry-pick --abort && echo "Conflict skipped" && exit 1)
39+
done
40+
41+
git push origin hdmi_frl_stable

0 commit comments

Comments
 (0)