From 2e9ab5819a5a1c55b5fd6ade66a6ba50b6421807 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 1 Nov 2025 14:28:42 +1000 Subject: [PATCH] chore: sync action for mfg repos (#6755) --- .github/workflows/sync_repos.yml | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/sync_repos.yml diff --git a/.github/workflows/sync_repos.yml b/.github/workflows/sync_repos.yml new file mode 100644 index 000000000..1b4cebe8f --- /dev/null +++ b/.github/workflows/sync_repos.yml @@ -0,0 +1,50 @@ +name: Sync from EdgeTX upstream + +on: + schedule: + - cron: '0 2 * * 1' # Weekly on Monday at 2 AM UTC + workflow_dispatch: # Manual trigger option + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.SYNC_PAT }} + + - name: Configure git + run: | + git config user.name "EdgeTX Sync Bot" + git config user.email "sync-bot@edgetx.org" + + - name: Sync branches from upstream (hard reset) + env: + BRANCHES: "main 2.11" # Add/modify branches here as needed + run: | + git remote add upstream https://github.com/EdgeTX/edgetx.git + git fetch upstream + + for branch in $BRANCHES; do + echo "=== Syncing branch: $branch ===" + + # Check if upstream has this branch + if ! git ls-remote --heads upstream | grep -q "refs/heads/$branch"; then + echo "⚠️ Branch $branch does not exist in upstream, skipping..." + continue + fi + + # Hard reset to upstream (creates exact copy with same SHA) + git checkout -B $branch upstream/$branch + + # Force push to origin + git push origin $branch --force + + echo "✓ Branch $branch synced (SHA: $(git rev-parse HEAD))" + done + + echo "" + echo "=== Sync Complete ===" + echo "All specified branches are now exact copies of upstream"