From 470460d09a8ac47107f01c092b53db47f8c831ae Mon Sep 17 00:00:00 2001 From: kemiao Date: Fri, 24 Apr 2026 07:41:40 -0700 Subject: [PATCH] Kay Miao and Karen Lau: Add success and failure notifications to workflow, and ensure failure notification not skipped --- .github/workflows/testsPython.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..9457c87 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -68,12 +68,20 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: always() #Added this line so that notification on failure will not be skipped by github actions runs-on: ubuntu-latest steps: - name: Notify on test results run: | if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" + echo "Python unit tests passed for ${{ github.repository }}." + echo "Branch: ${{ github.ref_name }}" + echo "Commit: ${{ github.sha }}" + echo "Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" else - echo "failure notifications go here" + echo "Python unit tests failed for ${{ github.repository }}." + echo "Branch: ${{ github.ref_name }}" + echo "Commit: ${{ github.sha }}" + echo "Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + echo "Please check the GitHub Actions logs for more details" fi