From b8131c8f0cbc3cf4cf12f7e409ece39e165ca04d Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Thu, 14 Jul 2022 14:53:58 +1000 Subject: [PATCH] ci: Select the correct sha for the test results when running from a post-merge action. --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53bbc6f18..7cbd0f081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,8 +48,13 @@ jobs: mkdir -p test-results # Don't use GITHUB_SHA as we need the head of the branch, not the # secret merge commit of the PR itself. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#pull-request-event-pull_request - echo ${{ github.event.pull_request.head.sha }} > test-results/sha-number + if [[ ${{ github.event_name }} == 'pull_request' ]]; then + echo ${{ github.event.pull_request.head.sha }} > test-results/sha-number + else + echo ${{ github.sha }} > test-result/sha-number + fi make --debug junit-regtest TESTCOVERPROFILE=coverprofile + shell: bash - uses: codecov/codecov-action@v3 if: always() with: