# inspired by rhinstaller/anaconda name: Trigger GitLab CI on: workflow_run: workflows: ["Tests"] types: [completed] jobs: trigger-gitlab: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest env: SCHUTZBOT_SSH_KEY: ${{ secrets.SCHUTZBOT_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 "${SCHUTZBOT_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 git@gitlab.com:osbuild/ci/osbuild.git if [ ${{ github.event.pull_request.number }} ]; then git checkout -b PR-${{ github.event.pull_request.number }} fi git push -f ci