Skip to content

Commit

Permalink
ci: use merge commit for pull_request_target
Browse files Browse the repository at this point in the history
It would be more correct to use a merge request commit instead of
original commit for pull_request_target.
  • Loading branch information
oleg-jukovec committed Nov 18, 2022
1 parent 48cf0c7 commit f852098
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,16 @@ jobs:

steps:
- name: Clone the connector
# `ref` as merge request is needed for pull_request_target because this
# target runs in the context of the base commit of the pull request.
uses: actions/checkout@v2
# This is needed for pull_request_target because this event runs in the
# context of the base commit of the pull request. It works fine for
# `push` and `workflow_dispatch` because the default behavior is used
# if `ref` and `repository` are empty.
if: github.event_name == 'pull_request_target'
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: Clone the connector
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v2

- name: Setup Tarantool ${{ matrix.sdk-version }}
run: |
Expand Down

0 comments on commit f852098

Please sign in to comment.