From e534ef35ee728536c8b2bbaeeb477b44556e3f86 Mon Sep 17 00:00:00 2001 From: Roque Lopez Date: Tue, 11 Jun 2024 11:15:50 -0400 Subject: [PATCH] Update push_gitlab.yml --- .github/workflows/push_gitlab.yml | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/push_gitlab.yml diff --git a/.github/workflows/push_gitlab.yml b/.github/workflows/push_gitlab.yml new file mode 100644 index 0000000..a628708 --- /dev/null +++ b/.github/workflows/push_gitlab.yml @@ -0,0 +1,37 @@ +name: Push to GitLab + +on: + push: + branches: + - '*' + +jobs: + mirror_to_gitlab: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history to ensure the current branch is fully included + + - name: Set up Git + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + + - name: Add GitLab remote + env: + GITLAB_URL: ${{ secrets.GITLAB_URL }} + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + run: | + git remote set-url origin https://oauth2:$GITLAB_TOKEN@$GITLAB_URL + + - name: Push current branch to GitLab + env: + GITLAB_URL: ${{ secrets.GITLAB_URL }} + GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} + run: | + # Push the current branch to GitLab + git push origin ${{ github.ref_name }} +