ci: Reactor perf tests checkout step to checkout the code correctly. (#19267)

Earlier code wasn't checked out correctly when test-build-docker workflow ran, this PR adds conditional checkout.
This commit is contained in:
Satish Gandham 2022-12-28 12:51:08 +05:30 committed by GitHub
parent 788cfe995b
commit 42a7c40c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,11 +44,19 @@ jobs:
ports:
- 27017:27017
steps:
# Check out merge commit between the PR branch & base branch
- name: Fork based /perf-test checkout
- name: Checkout the merged commit from PR and base branch
if: inputs.pr != 0
uses: actions/checkout@v3
with:
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
fetch-depth: 0
ref: refs/pull/${{ inputs.pr }}/merge
# Checkout the code in the current branch in case the workflow is called because of a branch push event
- name: Checkout the head commit of the branch
if: inputs.pr == 0
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Figure out the PR number
run: echo ${{ inputs.pr }}