Skip to content

Commit 7d4b3cc

Browse files
committed
ci: use merge commit for pull_request_target
It would be more correct to use a merge request commit instead of original commit for pull_request_target.
1 parent 48cf0c7 commit 7d4b3cc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/testing.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ jobs:
126126

127127
steps:
128128
- name: Clone the connector
129+
# `ref` as merge request is needed for pull_request_target because this
130+
# target runs in the context of the base commit of the pull request.
129131
uses: actions/checkout@v2
130-
# This is needed for pull_request_target because this event runs in the
131-
# context of the base commit of the pull request. It works fine for
132-
# `push` and `workflow_dispatch` because the default behavior is used
133-
# if `ref` and `repository` are empty.
132+
if: github.event_name == 'pull_request_target'
134133
with:
135-
ref: ${{github.event.pull_request.head.ref}}
136-
repository: ${{github.event.pull_request.head.repo.full_name}}
134+
ref: refs/pull/${{ github.event.pull_request.number }}/merge
135+
136+
- name: Clone the connector
137+
if: github.event_name != 'pull_request_target'
138+
uses: actions/checkout@v2
137139

138140
- name: Setup Tarantool ${{ matrix.sdk-version }}
139141
run: |

0 commit comments

Comments
 (0)