github-mailbot

command module
v0.0.0-...-2748437 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 9 Imported by: 0

README

GitHub Mailbot

Reusable GitHub Action for sending a commit email with the git diff everytime someone pushes to a branch. GitHub provides commit emails for PRs only, but those don't include the diff.

Example workflow file

name: Commit mailbot
on: push

jobs:
  mailbot:
    if: github.actor != 'dependabot[bot]'
    uses: sanjit-bhat/github-mailbot/.github/workflows/mailbot.yml@main
    with:
      host: smtp.gmail.com
      port: 587
      from: [email protected]
      to: [email protected],[email protected]
    secrets:
      password: ${{ secrets.MAILBOT_PASSWORD }}

This assumes a GitHub secret called MAILBOT_PASSWORD with the SMTP password for [email protected]. It doesn't run on commits from dependabot[bot] since those don't have secret access, resulting in a mailbot error.

TODO

  1. Find out how to get rid of "---" in git show output.
  2. Document how to use this.
  3. Add email screenshots.
  4. Document code.
  5. Add tests for the parts of the pipeline that are testable.
  6. Explain why we used reusable workflow vs. composable workflow.
  7. Cache at least specific versions of the brew pkgs.
  8. Delta removes color in the git show header. Maybe we can only pipe the diff part to delta.
  9. Set email time to the commit time.
  10. Document testing process. E2E testing on forked mailbot can use mailbot_repo flag.
  11. Document looking at GH action output log to see GH env json, which is passed to Go mailbot script and contains information that can be useful for debugging mailbot behavior and adding features.
  12. Don't run the mailbot workflow unless it can access the secret. E.g., dependabot PRs can't access the secret, so either they need to be given access, or the workflow should not run.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL