Skip to content

Send test failure notifications#30

Open
vjramani wants to merge 4 commits intoFullStackWithLawrence:mainfrom
vjramani:send-test-failure-notifications
Open

Send test failure notifications#30
vjramani wants to merge 4 commits intoFullStackWithLawrence:mainfrom
vjramani:send-test-failure-notifications

Conversation

@vjramani
Copy link
Copy Markdown

@vjramani vjramani commented Apr 24, 2026

Pull Request

Type of Change

  • New feature
  • Bug fix
  • Documentation
  • Refactor
  • Chore

Resolves

Implements automated email alerts for failed CI pipeline runs.

Changes

Modified the GitHub Actions workflow to ensure build failures are reported to the team immediately:

  • Workflow Reliability: Added if: always() to the notifications job to prevent it from being skipped when the testing job fails.
  • SMTP Integration: Replaced placeholder echo statements with the dawidd6/action-send-mail@v3 action for formal email delivery.
  • Contextual Notifications: Configured the email body to dynamically include the repository name, branch name, commit SHA, and a direct link to the failed logs for faster debugging.
  • Security & Variables: Added server and recipient configurations to GitHub Variables and used Secrets for the SMTP password to maintain security best practices.

Testing

  • Simulated Failure: Triggered the workflow with a failing test case to verify the notifications job executes as expected.
  • Metadata Accuracy: Confirmed the email body correctly renders ${{ github.ref_name }} and ${{ github.run_id }} for precise log linking.
  • Conditional Check: Verified that emails are only dispatched when the python-unit-tests job result is specifically 'failure'.

Screenshots

Email Notification Screenshot
image

Dependencies

  • dawidd6/action-send-mail@v3
  • Repository variables:
    • NOTIFICATION_MAIL_PORT
    • NOTIFICATION_MAIL_SERVER_ADDRESS
    • NOTIFICATION_MAIL_USERNAME
    • NOTIFICATION_TO_EMAIL
  • Repository secrets:
    • NOTIFICATION_MAIL_PASSWORD

Breaking Changes

None. This update adds a secondary notification job and does not modify the existing test environment or application code.

@vjramani
Copy link
Copy Markdown
Author

This is a pull request based for the Capstone Project: CI-CD Automation with GitHub Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant