Skip to content

Pull Request: Send Failure Notifications via Email#76

Open
vjramani wants to merge 5 commits intoFullStackWithLawrence:mainfrom
vjramani:main
Open

Pull Request: Send Failure Notifications via Email#76
vjramani wants to merge 5 commits intoFullStackWithLawrence:mainfrom
vjramani:main

Conversation

@vjramani
Copy link
Copy Markdown

@vjramani vjramani commented May 5, 2026

Pull Request: Send Failure Notifications via Email

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.

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