From 42a7c40c374331cf8665ecfe78b72b61f25dab27 Mon Sep 17 00:00:00 2001 From: Satish Gandham Date: Wed, 28 Dec 2022 12:51:08 +0530 Subject: [PATCH] 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. --- .github/workflows/perf-test.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/perf-test.yml b/.github/workflows/perf-test.yml index f34c8e2ae6..750985e8fc 100644 --- a/.github/workflows/perf-test.yml +++ b/.github/workflows/perf-test.yml @@ -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 }}