From 21819e33d5167f200fb226e4c33407d279825e6b Mon Sep 17 00:00:00 2001 From: Vijay Venkatramani Date: Tue, 21 Apr 2026 16:08:13 -0700 Subject: [PATCH 1/4] fix: added if: always() condition so that the notifications section executes even if tests fail in the workflow. --- .github/workflows/testsPython.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..e06cb4f 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -68,6 +68,7 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: always() runs-on: ubuntu-latest steps: - name: Notify on test results From 37059386d167b84cce3557baad822d6a7e0366de Mon Sep 17 00:00:00 2001 From: Vijay Venkatramani Date: Wed, 22 Apr 2026 12:37:33 -0700 Subject: [PATCH 2/4] ci: testing functionality to send email messages in the event of test failures. --- .github/workflows/testsPython.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index e06cb4f..fe86582 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -72,9 +72,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Notify on test results - run: | - if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" - else - echo "failure notifications go here" - fi + if: needs.python-unit-tests.result == 'failure' + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 587 + username: ${{ secrets.NOTIFICATION_MAIL_USERNAME }} + password: ${{ secrets.NOTIFICATION_MAIL_PASSWORD }} + + subject: "❌ CI Alert: Test Failure in ${{ github.repository }}" + body: | + The Python unit tests failed! + + Repository: ${{ github.repository }} + Branch: ${{ github.ref_name }} + Commit: ${{ github.sha }} + + View Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + + # Parameterized Recipient + to: ${{ secrets.NOTIFICATION_EMAIL }} + from: GitHub Actions Bot From 5033300317f214b21ff39138740d29e5295141c3 Mon Sep 17 00:00:00 2001 From: Vijay Venkatramani Date: Wed, 22 Apr 2026 12:56:40 -0700 Subject: [PATCH 3/4] fix: indentation --- .github/workflows/testsPython.yml | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index fe86582..62ce072 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -72,24 +72,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Notify on test results - if: needs.python-unit-tests.result == 'failure' - uses: dawidd6/action-send-mail@v3 - with: - server_address: smtp.gmail.com - server_port: 587 - username: ${{ secrets.NOTIFICATION_MAIL_USERNAME }} - password: ${{ secrets.NOTIFICATION_MAIL_PASSWORD }} - - subject: "❌ CI Alert: Test Failure in ${{ github.repository }}" - body: | - The Python unit tests failed! - - Repository: ${{ github.repository }} - Branch: ${{ github.ref_name }} - Commit: ${{ github.sha }} + if: needs.python-unit-tests.result == 'failure' + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 587 + username: ${{ secrets.NOTIFICATION_MAIL_USERNAME }} + password: ${{ secrets.NOTIFICATION_MAIL_PASSWORD }} - View Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - # Parameterized Recipient - to: ${{ secrets.NOTIFICATION_EMAIL }} - from: GitHub Actions Bot + subject: "❌ CI Alert: Test Failure in ${{ github.repository }}" + body: | + The Python unit tests failed! + + Repository: ${{ github.repository }} + Branch: ${{ github.ref_name }} + Commit: ${{ github.sha }} + + View Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + + to: ${{ secrets.NOTIFICATION_EMAIL }} + from: GitHub Actions Bot From 58b35b50685bf3c61a86bc9ae73c1b53766f5e15 Mon Sep 17 00:00:00 2001 From: Vijay Venkatramani Date: Fri, 24 Apr 2026 09:50:24 -0700 Subject: [PATCH 4/4] ci: Moved email and user name related from secrets to variables context and added server addr and port variables for better configurability. --- .github/workflows/testsPython.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 62ce072..45fcfdb 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -75,9 +75,9 @@ jobs: if: needs.python-unit-tests.result == 'failure' uses: dawidd6/action-send-mail@v3 with: - server_address: smtp.gmail.com - server_port: 587 - username: ${{ secrets.NOTIFICATION_MAIL_USERNAME }} + server_address: ${{vars.NOTIFICATION_MAIL_SERVER_ADDRESS}} + server_port: $${{vars.NOTIFICATION_MAIL_PORT}} + username: ${{ vars.NOTIFICATION_MAIL_USERNAME }} password: ${{ secrets.NOTIFICATION_MAIL_PASSWORD }} subject: "❌ CI Alert: Test Failure in ${{ github.repository }}" @@ -90,5 +90,5 @@ jobs: View Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - to: ${{ secrets.NOTIFICATION_EMAIL }} + to: ${{ vars.NOTIFICATION_TO_EMAIL }} from: GitHub Actions Bot