From aed01aa5e4e3838b6a8c2a2f30017c856dccc1ae Mon Sep 17 00:00:00 2001 From: adiholden Date: Tue, 27 Jun 2023 14:13:25 +0300 Subject: [PATCH] feat(github regression): add link to github job (#1482) * feat(regression): add github job link Signed-off-by: adi_holden --- .github/workflows/regression-tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 21852f02c..7f445e770 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -66,9 +66,8 @@ jobs: - name: Send notification on failure - if: failure() || cancelled() + if: failure() run: | - get_failed_tests() { local report_file=$1 echo $(jq -r '.tests[] | select(.outcome == "failed") | .nodeid' "$report_file") @@ -85,8 +84,12 @@ jobs: elif [ -f report.json ]; then failed_tests=$(get_failed_tests report.json) fi + + job_link="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + message="Regression tests failed.\\n The commit is: ${{github.sha}}.\\n $failed_tests \\n Job Link: ${job_link}\\n" + curl -s \ -X POST \ -H 'Content-Type: application/json' \ '${{ secrets.GSPACES_BOT_DF_BUILD }}' \ - -d "{\"text\": \"Regression tests failed.\\n The commit is ${{github.sha}}.\\n $failed_tests\"}" + -d '{"text": "'"${message}"'"}'