diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml deleted file mode 100644 index cc8c85e6352..00000000000 --- a/.github/workflows/repo-sync.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: postgres Repo Sync - -on: - schedule: - - cron: '18 19 * * *' - workflow_dispatch: - -jobs: - repo-sync: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout destination repo - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Configure git - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - - name: Add upstream and fetch all refs - run: | - git remote add upstream https://github.com/postgres/postgres.git - git fetch origin --prune - git fetch upstream --prune --tags - - - name: Sync branches except workflow files - shell: bash - run: | - set -euo pipefail - - git branch -r --format='%(refname:short)' | grep '^upstream/' | sed 's#^upstream/##' | while read -r branch; do - case "$branch" in - ""|HEAD|upstream) continue ;; - esac - - echo "Syncing branch: $branch" - - if git show-ref --verify --quiet "refs/heads/$branch"; then - git checkout "$branch" - git reset --hard "origin/$branch" - else - git checkout -B "$branch" "upstream/$branch" - fi - - git merge --no-edit "upstream/$branch" - - rm -rf .github/workflows - git add -A - git commit -m "Sync $branch from upstream excluding workflow files" || true - git push origin "$branch" - done - - - name: Sync tags - run: | - git push origin --tags