-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.01 KB
/
trigger-gitlab.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# # inspired by rhinstaller/anaconda
# name: Trigger GitLab CI
# on:
# pull_request:
# branches:
# - "main"
# jobs:
# trigger-gitlab:
# runs-on: ubuntu-latest
# env:
# SSH_KEY: ${{ secrets.GITLAB_SSH_KEY }}
# steps:
# - name: Clone repository
# uses: actions/checkout@v2
# with:
# # otherwise we are testing target branch instead of the PR branch (see pull_request_target trigger)
# ref: ${{ github.event.pull_request.head.sha }}
# fetch-depth: 0
# - name: Push to gitlab
# run: |
# mkdir -p ~/.ssh
# echo "${SSH_KEY}" > ~/.ssh/id_rsa
# chmod 400 ~/.ssh/id_rsa
# touch ~/.ssh/known_hosts
# ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
# git remote add ci [email protected]:yih1/test-ci.git
# if [ ${{ github.event.pull_request.number }} ]; then
# git checkout -b PR-${{ github.event.pull_request.number }}
# fi
# git push -f ci