File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Rebase release-dev/* onto main
2+
3+ on :
4+ schedule :
5+ - cron : " 0 20 * * *" # Runs at 8pm UTC daily
6+ workflow_dispatch :
7+
8+ jobs :
9+ rebase-release-dev :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+ token : ${{ secrets.GITHUB_TOKEN }}
18+
19+ - name : Setup Git
20+ run : |
21+ git config user.name "GitHub Actions"
22+ git config user.email "[email protected] " 23+
24+ - name : Fetch all remote branches
25+ run : |
26+ git fetch origin "+refs/heads/*:refs/remotes/origin/*"
27+
28+ - name : Rebase each release-dev/* branch onto main
29+ run : |
30+ MAIN_BRANCH=main
31+ for BRANCH in $(git branch -r | grep 'origin/release-dev/' | sed 's|origin/||'); do
32+ echo "Rebasing $BRANCH onto $MAIN_BRANCH"
33+ git checkout $BRANCH
34+ git rebase origin/$MAIN_BRANCH || {
35+ echo "Rebase failed for $BRANCH, skipping push"
36+ git rebase --abort
37+ continue
38+ }
39+ git push origin $BRANCH --force-with-lease
40+ done
You can’t perform that action at this time.
0 commit comments