Skip to content

Commit

Permalink
Try to merge code (from PR) first
Browse files Browse the repository at this point in the history
So that merged state is tested in Gitlab-CI
  • Loading branch information
jakob-fritz committed Apr 16, 2024
1 parent bcd64a5 commit d347bd3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/gitlab_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,23 @@ jobs:
with:
ref: "${{ env.USED_SHA }}"
persist-credentials: false
- name: check if fast-forward merge is possible
run: |
if [ "${{ github.event_name }}" == 'pull_request_target' ]
then
git checkout "${{ GITHUB_BASE_REF }}"
git pull
echo "MIRROR_BRANCH=TEMPORARY_MERGE_PR_${{ github.event.number }}" >> "$GITHUB_ENV"
git checkout -b "${{ github.env.MIRROR_BRANCH }}"
git merge --ff-only "${{ github.event.pull_request.head.sha }}"
fi
- name: Mirror and wait for Gitlab-CI
uses: jakob-fritz/github2lab_action@v0.6
uses: jakob-fritz/github2lab_action@Iss37_variable_for_checkout
env:
MODE: 'all' # Either 'mirror', 'get_status', 'get_artifact', or 'all'
GITLAB_TOKEN: ${{ secrets.GITLAB_SECRET }}
FORCE_PUSH: "true"
GITLAB_HOSTNAME: "gitlab.jsc.fz-juelich.de"
GITLAB_PROJECT_ID: "6029"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIRROR_BRANCH: ${{ env.MIRROR_BRANCH }}

0 comments on commit d347bd3

Please sign in to comment.