Commit 0d1f5130 authored by Jorge Echevarria Uribarri's avatar Jorge Echevarria Uribarri Committed by GitHub
Browse files

Create gitlab.yml

parent b418ef27
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
name: Sync GitHub to GitLab

on:
  push:
    branches:
      - develop  # Se activa cuando hay cambios en la rama develop

jobs:
  sync:
    runs-on: ubuntu-latest

    steps:
      # 1. Checkout del código desde GitHub
      - name: Checkout GitHub repository
        uses: actions/checkout@v4

      # 2. Configurar Git para empujar a GitLab
      - name: Push to GitLab main
        env:
          GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
        run: |
          # Configurar Git
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"

          # Agregar el repositorio remoto de GitLab
          git remote add gitlab https://oauth2:${GITLAB_TOKEN}@labs.etsi.org/rep/ocf/sdk.git

          # Forzar el push de la rama develop a main en GitLab
          git push -u gitlab develop:main --force