Sync-To-Gitlab 1d4dc153cda0d6fbb53957b0a8fa8a1254d170ad #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync-To-Gitlab | |
run-name: Sync-To-Gitlab ${{ github.sha }} | |
on: | |
push: | |
branches: | |
- master | |
- master-template | |
pull_request_target: | |
types: | |
- closed | |
branches: | |
- master | |
- master-template | |
workflow_dispatch: | |
jobs: | |
sync: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
name: "Sync To Gitlab" | |
if: github.event.pull_request.merged == true || github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Mirror | |
env: | |
input_git_config_user_name: ${{ secrets.GITLAB_USERNAME }} | |
input_git_config_user_email: ${{ secrets.GITLAB_EMAIL }} | |
input_git_remote_url: ${{ secrets.GITLAB_URL }} | |
input_git_push_options: --force | |
run: | | |
git config --global user.name "${{ env.input_git_config_user_name }}" | |
git config --global user.email "${{ env.input_git_config_user_email }}" | |
git clone "https://github.com/${{ github.repository }}.git" "git" | |
cd git | |
git remote set-url origin "${{ env.input_git_remote_url }}" | |
git push ${{ env.input_git_push_options }} origin ${{ github.ref_name }}:${{ github.ref_name }} | |
# - name: Mirror + trigger CI | |
# uses: SvanBoxel/gitlab-mirror-and-ci-action@master | |
# with: | |
# args: "https://gitlab.com/Zerek-Cheng/Simple-Assets-Platform" | |
# env: | |
# FORCE_PUSH: "true" | |
# GITLAB_HOSTNAME: "gitlab.com" | |
# GITLAB_USERNAME: "Zerek-Cheng" | |
# GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} | |
# GITLAB_PROJECT_ID: "40146411" | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |