From cdbc4b1b8f3eb6ca0fa5e520feae4b62dbe56ccc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Dec 2025 22:28:22 +0000 Subject: [PATCH 1/2] Add GitHub workflow to mirror branches to GitLab This workflow automatically mirrors all branches (except main/master) to a GitLab repository. It uses GITLAB_TOKEN secret for authentication and supports configurable GITLAB_URL and GITLAB_REPO variables. --- .github/workflows/mirror-to-gitlab.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/mirror-to-gitlab.yml diff --git a/.github/workflows/mirror-to-gitlab.yml b/.github/workflows/mirror-to-gitlab.yml new file mode 100644 index 0000000..0dc6160 --- /dev/null +++ b/.github/workflows/mirror-to-gitlab.yml @@ -0,0 +1,37 @@ +name: Mirror to GitLab + +on: + push: + branches: + - '**' + - '!main' + - '!master' + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Mirror to GitLab + env: + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + GITLAB_URL: ${{ vars.GITLAB_URL || 'https://gitlab.com' }} + GITLAB_REPO: ${{ vars.GITLAB_REPO || 'postgres-ai/platform-ui' }} + run: | + # Configure git + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "GitHub Actions" + + # Add GitLab remote with token auth + git remote add gitlab "https://oauth2:${GITLAB_TOKEN}@${GITLAB_URL#https://}/${GITLAB_REPO}.git" + + # Push the current branch + BRANCH_NAME="${GITHUB_REF#refs/heads/}" + echo "Pushing branch: ${BRANCH_NAME}" + git push gitlab "HEAD:refs/heads/${BRANCH_NAME}" --force + + echo "Successfully mirrored to GitLab" From f56dc615b74a55a8d8fc9edaa5427feef1af1ef4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Dec 2025 22:43:24 +0000 Subject: [PATCH 2/2] Fix default GITLAB_REPO to postgres_ai --- .github/workflows/mirror-to-gitlab.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror-to-gitlab.yml b/.github/workflows/mirror-to-gitlab.yml index 0dc6160..0944bde 100644 --- a/.github/workflows/mirror-to-gitlab.yml +++ b/.github/workflows/mirror-to-gitlab.yml @@ -20,7 +20,7 @@ jobs: env: GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} GITLAB_URL: ${{ vars.GITLAB_URL || 'https://gitlab.com' }} - GITLAB_REPO: ${{ vars.GITLAB_REPO || 'postgres-ai/platform-ui' }} + GITLAB_REPO: ${{ vars.GITLAB_REPO || 'postgres-ai/postgres_ai' }} run: | # Configure git git config --global user.email "github-actions[bot]@users.noreply.github.com"