Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

chore: update sync main to canary workflow

rdmclin29c0916015490
diff --git a/.github/workflows/sync-main-to-canary.yaml b/.github/workflows/sync-main-to-canary.yaml
new file mode 100644
index 00000000000..5b53b6c6bb4
--- /dev/null
+++ b/.github/workflows/sync-main-to-canary.yaml
@@ -0,0 +1,46 @@
+name: πŸ”„ Branch Synchronization
+
+on:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ sync-branches:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v6
+ with:
+ fetch-depth: 0
+
+ - name: Set up Git
+ run: |
+ git config --global user.name 'lobehubbot'
+ git config --global user.email '[email protected]'
+
+ - name: Prepare sync branch
+ id: branch
+ run: |
+ echo "SYNC_BRANCH_MAIN_CANARY=sync/main-to-canary-$(date +'%Y%m%d')" >> $GITHUB_ENV
+
+ - name: Sync main to canary
+ if: github.ref == 'refs/heads/main'
+ run: |
+ # Sync main to canary
+ git checkout main
+ SYNC_BRANCH_CANARY=${{ env.SYNC_BRANCH_MAIN_CANARY }}
+ git checkout -B $SYNC_BRANCH_CANARY
+ DIFF=$(git diff origin/canary...)
+ if [ -z "$DIFF" ]; then
+ echo "No changes to sync"
+ exit 0
+ fi
+ git push origin $SYNC_BRANCH_CANARY -f
+ gh pr create --base canary --head $SYNC_BRANCH_CANARY --title "Sync main branch to canary branch" --body "Automatic sync" || exit 0
+ env:
+ GH_TOKEN: ${{ github.token }}
diff --git a/.github/workflows/sync-main-to-dev.yaml b/.github/workflows/sync-main-to-dev.yaml
deleted file mode 100644
index ee0f9e36ce3..00000000000
--- a/.github/workflows/sync-main-to-dev.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: πŸ”„ Branch Synchronization
-
-on:
- push:
- branches:
- - main
-
-jobs:
- sync-branches:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v6
- with:
- fetch-depth: 0
-
- - name: Set up Git
- run: |
- git config --global user.name 'GitHub Actions'
- git config --global user.email '[email protected]'
-
- - name: Prepare sync branch
- id: branch
- run: |
- echo "SYNC_BRANCH_MAIN_DEV=sync/main-to-dev-$(date +'%Y%m%d')" >> $GITHUB_ENV
-
- - name: Sync main to dev
- if: github.ref == 'refs/heads/main'
- run: |
- # Sync main to dev
- git checkout main
- SYNC_BRANCH_DEV=${{ env.SYNC_BRANCH_MAIN_DEV }}
- git checkout -B $SYNC_BRANCH_DEV
- DIFF=$(git diff origin/dev...)
- if [ -z "$DIFF" ]; then
- echo "No changes to sync"
- exit 0
- fi
- git push origin $SYNC_BRANCH_DEV -f
- gh pr create --base dev --head $SYNC_BRANCH_DEV --title "Sync main branch to dev branch" --body "Automatic sync" || exit 0
- env:
- GH_TOKEN: ${{ github.token }}