Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to GitLab #6

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/push_gitlab.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]'

- 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 }}

Loading