Skip to content
Snippets Groups Projects
Commit ef6a8664 authored by Jakob Fritz's avatar Jakob Fritz
Browse files

Set sha for checkout properly

parent be3aef75
Branches
No related tags found
No related merge requests found
......@@ -45,12 +45,12 @@ jobs:
(github.event_name == 'push') ||
(github.event_name == 'schedule')
run: exit 0
- name: Fail for other triggers
if: >-
(github.event_name != 'push') &&
(github.event_name != 'schedule') &&
(github.event_name != 'pull_request_target')
run: exit 1
# - name: Fail for other triggers
# if: >-
# (github.event_name != 'push') &&
# (github.event_name != 'schedule') &&
# (github.event_name != 'pull_request_target')
# run: exit 1
mirror_to_gitlab:
runs-on: ubuntu-latest
......@@ -65,10 +65,21 @@ jobs:
needs:
- check_permission
steps:
- name: set proper sha
run: |
echo "${{ github.event_name }}"
if [ "${{ github.event_name }}" == 'push' ] || [ "${{ github.event_name }}" == 'schedule' ]
then
echo "USED_SHA=${{ github.sha }}" >> "$GITHUB_ENV"
fi
if [ "${{ github.event_name }}" == 'pull_request_target' ]
then
echo "USED_SHA=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV"
fi
- name: Checkout
uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.head.sha }}"
ref: "${{ env.USED_SHA }}"
persist-credentials: false
- name: Mirror and wait for Gitlab-CI
uses: jakob-fritz/github2lab_action@Iss35_mirror_pr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment