diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 6a648a1f89..820465e544 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -653,20 +653,24 @@ jobs: app_id: ${{ env.FUNCTIONAL_TEST_APP_ID }} private_key: ${{ secrets.FUNCTIONAL_TEST_APP_PRIVATE_KEY }} - name: Get tests job status - run: | + id: get_test_status + run: | + TEST_STATUS=failure # default to failure # from: https://github.com/orgs/community/discussions/26526#discussioncomment-3252209 jobstatus=$(curl -X GET -s -u "admin:${{ steps.get_installation_token.outputs.token }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq ".jobs[] | {job_status: .conclusion, matrix: .name}") # if jobstatus contains failure if echo "$jobstatus" | grep -q "failure"; then - echo "TEST_STATUS=failure" >> $GITHUB_ENV + TEST_STATUS=failure elif echo "$jobstatus" | grep -q "cancelled"; then - echo "TEST_STATUS=cancelled" >> $GITHUB_ENV + TEST_STATUS=cancelled else - echo "TEST_STATUS=success" >> $GITHUB_ENV + # if no failures, then it's a success + TEST_STATUS=success fi echo "Test Status: $jobstatus" - echo "Setting test status to $TEST_STATUS" + echo "Test Status: $TEST_STATUS" + echo "test_status=$TEST_STATUS" >> $GITHUB_ENV - uses: LouisBrunner/checks-action@v1.6.1 if: always() with: @@ -675,7 +679,7 @@ jobs: repo: ${{ github.repository }} sha: ${{ env.CHECKOUT_REF }} status: completed - conclusion: ${{ env.TEST_STATUS }} + conclusion: ${{ steps.get_test_status.outputs.test_status }} output: | {"summary":"Functional Test run completed. See links for more information.","title":"Functional Test Run"} details_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}