Skip to content

Commit

Permalink
Moved the check of condition from shell to yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob-fritz committed Apr 16, 2024
1 parent d347bd3 commit 8a316e2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/gitlab_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,13 @@ jobs:
ref: "${{ env.USED_SHA }}"
persist-credentials: false
- name: check if fast-forward merge is possible
if: github.event_name == 'pull_request_target'
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
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 }}"
- name: Mirror and wait for Gitlab-CI
uses: jakob-fritz/github2lab_action@Iss37_variable_for_checkout
env:
Expand Down

0 comments on commit 8a316e2

Please sign in to comment.