Skip to content

Use token for authentication #4

Use token for authentication

Use token for authentication #4

Workflow file for this run

name: Push to GitLab
on:
push:
branches:
- gitlab
jobs:
push_to_gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Ensure main branch exists
run: |
git checkout -b main || git checkout main
- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
- name: Add GitLab remote and push
env:
GITLAB_URL: ${{ secrets.GITLAB_URL }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
git remote add gitlab https://oauth2:$GITLAB_TOKEN@$GITLAB_URL
git push -u gitlab main