early-warning.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. name: Early Warning Notifier
  2. on:
  3. push:
  4. branches: master
  5. release:
  6. types: [published]
  7. schedule:
  8. - cron: "0 0 * * *"
  9. jobs:
  10. sanity-check:
  11. runs-on: ubuntu-latest
  12. name: Sanity Check
  13. steps:
  14. - uses: actions/checkout@v2
  15. - uses: actions/setup-python@v2
  16. with:
  17. python-version: '3.10'
  18. - name: Setup environment
  19. run: pip install -r requirements.txt
  20. - name: Perform check
  21. run: python -m howdoi --sanity-check --explain
  22. - name: Notify if check does not pass
  23. if: ${{ failure() }}
  24. uses: dawidd6/action-send-mail@v2
  25. with:
  26. # mail server settings
  27. server_address: ${{ secrets.EMAIL_SERVER_ADDRESS }}
  28. server_port: ${{ secrets.EMAIL_SERVER_PORT }}
  29. # user credentials
  30. username: ${{ secrets.EMAIL_USERNAME }}
  31. password: ${{ secrets.EMAIL_PASSWORD }}
  32. # email subject
  33. subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
  34. # email body as text
  35. body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has status ${{ job.status }}
  36. # comma-separated string, send email to
  37. to: gleitz@mit.edu
  38. # from email name
  39. from: Howdoi Early Warning System